Repository navigation
[XPU][MaskedSelect] Fix masked_select_grad true_count and empty-out h… - #76906
Merged
QingshuChen merged 1 commit intoDec 16, 2025
Merged
QingshuChen merged 1 commit into
QingshuChen merged 1 commit into
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
Author
|
/re-run all-cancelled |
Contributor
Author
|
/re-run all-failed |
cqulilujia
reviewed
Dec 14, 2025
| return; | ||
| } | ||
| // If out_grad is empty (e.g. mask all false), x_grad should be all zeros. | ||
| if (out_grad.numel() == 0) { |
Contributor
bigwhite37
force-pushed
the
fix/xpu-masked-select-grad-true-count
branch
from
December 14, 2025 12:54
29da1ea to
e3ddabc
Compare
Contributor
Author
|
/re-run all-cancelled |
Contributor
Author
|
/re-run all-failed |
2 similar comments
Contributor
Author
|
/re-run all-failed |
Contributor
Author
|
/re-run all-failed |
QingshuChen
reviewed
Dec 15, 2025
| DenseTensor* x_grad) { | ||
| using XPUType = typename XPUTypeTrait<T>::Type; | ||
| dev_ctx.template Alloc<T>(x_grad); | ||
| if (x_grad->numel() == 0) { |
Collaborator
There was a problem hiding this comment.
参考下一个写法, 如果x_grad有可能为null, x_grad->numel调用就有问题.
bigwhite37
force-pushed
the
fix/xpu-masked-select-grad-true-count
branch
from
December 15, 2025 09:21
e3ddabc to
f9257db
Compare
Contributor
Author
|
/re-run all-failed |
1 similar comment
Contributor
Author
|
/re-run all-failed |
QingshuChen
approved these changes
Dec 16, 2025
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.
PR Category
Custom Device
PR Types
Bug fixes
Description
out_grad.numel()) to the underlying XDNN API instead of a constant.