Skip to content

[release/3.4][Operator Mechanism] fix BroadcastConfig do not support big_tensor#79440

Open
feixi139 wants to merge 8 commits into
PaddlePaddle:release/3.4from
feixi139:release34_fix_broadcast
Open

[release/3.4][Operator Mechanism] fix BroadcastConfig do not support big_tensor#79440
feixi139 wants to merge 8 commits into
PaddlePaddle:release/3.4from
feixi139:release34_fix_broadcast

Conversation

@feixi139

@feixi139 feixi139 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

BroadcastConfig 中使用 FastDivMod 对输出线性索引进行维度坐标拆解。当 tensor 某一维度大小超过 INT_MAX(2^31 - 1)时,int 类型发生溢出,导致索引计算错误,广播结果产生静默错误。

修复

将 BroadcastConfig 中的 FastDivMod 替换为 FastDivMod<int64_t>,移除 PADDLE_ENFORCE_LE_INT_MAX 的限制,使广播操作支持单维度超过 2^31 的大 tensor。

devPR:#79439

是否引起精度变化

fix bugs
@feixi139 feixi139 changed the title [release/3.4][Operator Mechanism] fix Broadcast do not support big_tensor [release/3.4][Operator Mechanism] fix BroadcastConfig do not support big_tensor Jul 8, 2026
PaddlePaddle-bot

This comment was marked as outdated.

@paddle-bot paddle-bot Bot added the contributor External developers label Jul 8, 2026
PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

@PaddlePaddle-bot

PaddlePaddle-bot commented Jul 9, 2026

Copy link
Copy Markdown

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-07-11 21:26:23 UTC+08:00

CI报告基于以下代码生成(30分钟更新一次):
PR commit: 95f21f7 | Merge base: eaa369b (branch: release/3.4)


1 Required任务 : 19/20 通过

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
63(32) 31 30 1 0 0 0
任务 错误类型 置信度 日志
Check approval 需要 Approval Job

2 失败详情

🔴 Check approval — 需要 Approval(置信度: 高)

该 Job 需要人工 Approval,完成审批后 CI 才会继续执行。

修复建议:请通过人工审批。

PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Paddle-CI-Agent | pr_review | 2026-07-13 17:41:28

📋 Review 摘要

PR 概述:修复 BroadcastConfig 大维度广播索引计算,GPU 路径将广播索引拆解提升到 64 位,XPU 路径保留 INT_MAX 保护。
变更范围paddle/phi/kernels/funcs/paddle/phi/kernels/primitive/
影响面 TagOperator Mechanism

问题

未发现阻塞性问题。PR 规范问题在下面章节报,不要在这里重复

📝 PR 规范检查

标题不符合 release 分支 cherry-pick 格式:当前 PR body 已包含 develop 原 PR 链接,但标题没有使用 checklist 要求的 [Cherry-Pick][Tag] 标题描述(#原PR号) 格式。描述结构符合规范。

标题建议(可直接复制):

  • [Cherry-Pick][Operator Mechanism] fix Broadcast support for big tensor(#79439)
PR 描述建议(点击展开,可直接复制)
### PR Category
<!-- One of [ User Experience | Execute Infrastructure | Operator Mechanism | CINN | Custom Device | Performance Optimization | Distributed Strategy | Parameter Server | Communication Library | Auto Parallel | Inference | Environment Adaptation ] -->
Operator Mechanism

### PR Types
<!-- One of [ New features | Bug fixes | Improvements | Performance | BC Breaking | Deprecations | Docs | Devs | Not User Facing | Security | Others ] -->
Bug fixes

### Description
<!-- Describe what you’ve done -->
BroadcastConfig 中使用 FastDivMod<int> 对输出线性索引进行维度坐标拆解。当 tensor 某一维度大小超过 INT_MAX(2^31 - 1)时,int 类型发生溢出,导致索引计算错误,广播结果产生静默错误。

本 PR 将 BroadcastConfig 中的 FastDivMod<int> 替换为 FastDivMod<int64_t>,并将相关广播索引和 stride 累乘提升到 int64_t,以支持单维度超过 2^31 的大 tensor。

devPR:https://github.com/PaddlePaddle/Paddle/pull/79439

### 是否引起精度变化
<!-- one of the following [ 是 | 否 ]-->

总体评价

本轮按 checklist A2/B2/B6 覆盖了 BroadcastConfigReadDataBcVectorizedBroadcastKernel、写回路径以及 XPU datamover 相关调用链,未发现本次 diff 引入的阻塞性代码问题。PR 标题仍需按 release cherry-pick 格式调整。

@paddle-bot

paddle-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants