[BugFix]fix handle 4 return values from noaux_tc_redundant op#6384
Open
mattheliu wants to merge 3 commits intoPaddlePaddle:developfrom
Open
[BugFix]fix handle 4 return values from noaux_tc_redundant op#6384mattheliu wants to merge 3 commits intoPaddlePaddle:developfrom
mattheliu wants to merge 3 commits intoPaddlePaddle:developfrom
Conversation
The noaux_tc_redundant CUDA op is defined with 4 outputs in PD_BUILD_STATIC_OP: - output_tensor (scores) - topk_values - topk_indices - tokens_per_expert_stats_list_out (inplace updated) The Python code was only unpacking 3 values, causing: ValueError: too many values to unpack (expected 3) This fix correctly unpacks all 4 return values, ignoring the inplace updated tensor which is the same as the input tokens_per_expert_stats_list. Co-Authored-By: Claude (Claude Opus 4.5) <noreply@anthropic.com>
|
Thanks for your contribution! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6384 +/- ##
==========================================
Coverage ? 67.57%
==========================================
Files ? 391
Lines ? 52240
Branches ? 8145
==========================================
Hits ? 35303
Misses ? 14350
Partials ? 2587
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The PD_BUILD_STATIC_OP defines 4 outputs but the function only returned 3, causing inconsistent behavior across different Paddle framework versions. This fix explicitly returns 4 values: - scores (inplace modified) - topk_values - topk_indices - tokens_per_expert_stats_list (inplace modified via atomicAdd) Co-Authored-By: Claude (Claude Opus 4.5) <noreply@anthropic.com>
c8c20c7 to
6535bd1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
修复
noaux_tc_redundant算子返回值不一致导致的测试失败。问题根因:
noaux_tc_redundant时,PD_BUILD_STATIC_OP定义了 4 个输出,但 CUDA 函数只返回 3 个值Modifications
custom_ops/gpu_ops/noaux_tc_redundant.cu:修改函数返回值从 3 个改为 4 个,与 OP 定义一致fastdeploy/model_executor/layers/moe/moe.py:恢复 PR [Feature] Support noaux for eplb #5143 原始设计,接收 4 个返回值Usage or Command
# 运行测试 pytest tests/operators/test_noaux_tc_redundant.py -vAccuracy Tests
使用现有测试
tests/operators/test_noaux_tc_redundant.py验证:Checklist
pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.