[release/3.4][Operator Mechanism] fix BroadcastConfig do not support big_tensor#79440
[release/3.4][Operator Mechanism] fix BroadcastConfig do not support big_tensor#79440feixi139 wants to merge 8 commits into
Conversation
CI报告基于以下代码生成(30分钟更新一次): 1 Required任务 : 19/20 通过
2 失败详情🔴 Check approval — 需要 Approval(置信度: 高)该 Job 需要人工 Approval,完成审批后 CI 才会继续执行。 修复建议:请通过人工审批。 |
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 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/
影响面 Tag:Operator 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 覆盖了 BroadcastConfig、ReadDataBc、VectorizedBroadcastKernel、写回路径以及 XPU datamover 相关调用链,未发现本次 diff 引入的阻塞性代码问题。PR 标题仍需按 release cherry-pick 格式调整。
|
你的PR提交成功,感谢你对开源项目的贡献! |
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
是否引起精度变化
否