[BugFix] Fix platform-specific attribute access in reset_model_inputs#6614
Open
kevincheng2 wants to merge 1 commit intoPaddlePaddle:developfrom
Open
[BugFix] Fix platform-specific attribute access in reset_model_inputs#6614kevincheng2 wants to merge 1 commit intoPaddlePaddle:developfrom
kevincheng2 wants to merge 1 commit intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
9dbef4f to
40525af
Compare
修复 `ProposerInputBatch.reset_model_inputs` 方法中的平台属性访问错误。 在 CUDA 平台上,代码错误地尝试访问 `output_cum_offsets` 和 `output_padding_offset` 属性, 但这些属性仅在非 CUDA 平台上初始化,导致错误: "'output cum offsets' is not a valid attribute of InputBatch" - 将 `output_cum_offsets` 和 `output_padding_offset` 的重置代码移到 `else` 分支(非 CUDA 平台) - 在 `if current_platform.is_cuda()` 分支中添加 `cu_seqlens_q_output` 和 `batch_id_per_token_output` 的重置代码 这与初始化逻辑(第 285-298 行)保持一致,确保不同平台访问正确的属性。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40525af to
6fb8161
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6614 +/- ##
==========================================
Coverage ? 71.64%
==========================================
Files ? 394
Lines ? 53754
Branches ? 8437
==========================================
Hits ? 38511
Misses ? 12473
Partials ? 2770
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:
|
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
修复
ProposerInputBatch.reset_model_inputs方法中的平台属性访问错误。在 CUDA 平台上,代码错误地尝试访问
output_cum_offsets和output_padding_offset属性,但这些属性仅在非 CUDA 平台上初始化,导致错误:Modifications
output_cum_offsets和output_padding_offset的重置代码移到else分支(非 CUDA 平台)if current_platform.is_cuda()分支中添加cu_seqlens_q_output和batch_id_per_token_output的重置代码这与初始化逻辑(第 285-298 行)保持一致,确保不同平台访问正确的属性。
Usage or Command
无需额外命令,修复后代码会根据平台自动选择正确的属性进行重置。
Checklist
[BugFix]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.