Skip to content

[Cherry-Pick][release/3.4] Fix silent data loss in interpolate NCHW kernels when out_h exceeds 65535*block.y (#79833) - #79840

Merged
sneaxiy merged 3 commits into
PaddlePaddle:release/3.4from
omoYang:cp-79833-release3.4
Oct 10, 2026
Merged

sneaxiy merged 3 commits into
PaddlePaddle:release/3.4from
omoYang:cp-79833-release3.4

Conversation

@omoYang

@omoYang omoYang commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

devPR:#79833

是否引起精度变化

否

…rpNCHWFw and KeNearestNeighborInterpNCHWFw kernel.

(cherry picked from commit a3f0f18)
(cherry picked from commit 80f185f)

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 本 PR 是对 develop 分支 #79833 的 cherry-pick,代码改动(三个 NCHW 插值 kernel 增加 grid-stride 循环 + 回归测试)与原 PR 内容一致,逻辑经核对正确:GetGpuLaunchConfig3D 会将 grid_y 裁剪到 max_grid_dim[1](65535),新增的 y_stride = blockDim.y * gridDim.y 循环能正确覆盖被裁剪掉的尾部输出行,修复符合预期。

但 #79833 当前仍为 OPEN、尚未合入 develop。按常规流程,release 分支的 cherry-pick 应在源 PR 合入后再提,否则若 #79833 在评审过程中发生改动,本回合内容会与最终合入版本产生分叉。建议待 #79833 合入 develop 后,再确认两者 diff 一致并推进本 PR 的合入。

@omoYang

omoYang commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/re-run all-failed

wanghuancoder
wanghuancoder previously approved these changes Oct 9, 2026

@wanghuancoder wanghuancoder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

The 65536x256 output made the per-pixel numpy reference and the numeric
gradient take ~350s (bilinear) and ~200s (nearest), exceeding the CI
per-test timeout. Add a ref_output hook to the base OpTest classes, and
override it in the GridYClamp cases with a vectorized reference; pass an
analytic reference gradient via user_defined_grads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Paddle-Review-Bot

Paddle-Review-Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Paddle-Bot Review Board (review完成)

序号 位置 优先级 规则来源 状态
1 cherry-pick 源 PR #79833 尚未合入 develop P2 默认规则 🚧

Powered by Nyanpasu claude with Opus 4.8 默认推理级别, please check the suggestions carefully.

@Paddle-Review-Bot Paddle-Review-Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 本 PR 为对 develop #79833 的 cherry-pick。最新提交将 GridYClamp 回归测试改为向量化参考值 + 解析梯度(ref_output 钩子不改变既有子类行为;最近邻/双线性的 ref_output 与 ref_x_grad 已核对,与原逐像素实现等价,解析梯度对应 check_grad 默认的 mean(Out) 损失、除以 Out.size 正确),改动本身无问题。

但 #79833 当前仍为 OPEN、尚未合入 develop。按常规流程,release 分支的 cherry-pick 应在源 PR 合入后再推进,否则若 #79833 在评审中继续改动,本 PR 会与最终合入版本分叉。建议待 #79833 合入 develop、确认两者 diff 一致后再推进本 PR 的合入。

@sneaxiy
sneaxiy merged commit 54ae405 into PaddlePaddle:release/3.4 Oct 10, 2026
167 of 180 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants