-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Fix index_add for int64 input + zerodim index #161511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gh/manuelcandales/11/base
Are you sure you want to change the base?
Fix index_add for int64 input + zerodim index #161511
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161511
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New FailuresAs of commit ac6d1f0 with merge base 818ba43 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a regression test please?
| indices.emplace_back(); | ||
| } | ||
| indices.emplace_back(index.to(at::kLong)); | ||
| const Tensor index_ = (index.dim() == 0) ? index.view(1).to(at::kLong) : index.to(at::kLong); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Binding result to a tensor creates unnecessary copy
| const Tensor index_ = (index.dim() == 0) ? index.view(1).to(at::kLong) : index.to(at::kLong); | |
| const auto&& index_ = (index.dim() == 0) ? index.view(1).to(at::kLong) : index.to(at::kLong); |
| const Tensor result_ = (result.dim() == 0) ? result.view(1) : result; | ||
| const Tensor source_ = (source.dim() == 0) ? source.view(1) : source; | ||
| result_.index_put_(indices, source_.mul(alpha), true); | ||
| const Tensor alpha_ = at::scalar_tensor(alpha, source_.options()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this one is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the issue, there was also an error when alpha was floating point
|
@pytorchbot merge -f "Lint + MPS are green" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot revert -m "broke test_indexing.py::TestIndexingCPU::test_index_add_zerodim_index_floating_alpha_cpu GH job link HUD commit link on dynamo?" -c ignoredsignal |
|
@pytorchbot successfully started a revert job. Check the current status here. |
This reverts commit d514866. Reverted #161511 on behalf of https://github.com/clee2000 due to broke test_indexing.py::TestIndexingCPU::test_index_add_zerodim_index_floating_alpha_cpu [GH job link](https://github.com/pytorch/pytorch/actions/runs/17257089116/job/48971728595) [HUD commit link](https://hud.pytorch.org/pytorch/pytorch/commit/d51486616cb3fe54bc298669a88059be56c1fb22) on dynamo? ([comment](#161511 (comment)))
|
@manuelcandales your PR has been successfully reverted. |
Fixes pytorch#161446 Pull Request resolved: pytorch#161511 Approved by: https://github.com/malfet
This reverts commit d514866. Reverted pytorch#161511 on behalf of https://github.com/clee2000 due to broke test_indexing.py::TestIndexingCPU::test_index_add_zerodim_index_floating_alpha_cpu [GH job link](https://github.com/pytorch/pytorch/actions/runs/17257089116/job/48971728595) [HUD commit link](https://hud.pytorch.org/pytorch/pytorch/commit/d51486616cb3fe54bc298669a88059be56c1fb22) on dynamo? ([comment](pytorch#161511 (comment)))
Fixes #161446
Stack from ghstack (oldest at bottom):