Skip to content

[Operator Mechanism] Remove unbind int32 element limit - #79737

Merged
zhengshengning merged 2 commits into
PaddlePaddle:developfrom
omoYang:fix-unbind-bigtensor-interception
Sep 10, 2026
Merged

zhengshengning merged 2 commits into
PaddlePaddle:developfrom
omoYang:fix-unbind-bigtensor-interception

Conversation

@omoYang

@omoYang omoYang commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

修复 unbind 对输入 Tensor 总元素数超过 2^31 - 1 时被错误拦截的问题。

当前unbind的常规GPU路径和stride 路径均存在针对x.numel()INT_MAX限制,导致大规模MoE Tensor在执行 unbind 时直接报错。相关实现后续已经支持根据数据规模选择int64_t索引路径,因此移除两处不再必要的元素数量检查:

  • paddle/phi/kernels/impl/unbind_kernel_impl.h
  • paddle/phi/kernels/stride/unbind_kernel.cc

是否引起精度变化

wanghuancoder
wanghuancoder previously approved these changes Sep 3, 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

@omoYang

omoYang commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

/re-run all-failed

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@519f66e). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #79737   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?         1           
  Branches           ?         0           
===========================================
  Hits               ?         1           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@omoYang

omoYang commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

/re-run all-failed

1 similar comment
@omoYang

omoYang commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/re-run all-failed

@zhengshengning
zhengshengning merged commit 71b2f32 into PaddlePaddle:develop Sep 10, 2026
223 of 240 checks passed
omoYang added a commit to omoYang/Paddle_fork that referenced this pull request Sep 15, 2026
Backport the SplitFunctor<CPUContext> int->int64_t narrowing fix from
PaddlePaddle#79246 so unbind/split on CPU no longer overflows when a per-output
column count exceeds INT_MAX (e.g. unbind([2, 2^31], axis=0) via the
non-strided path). Pairs with PaddlePaddle#79737 which removed the numel<=INT_MAX
guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants