-
Notifications
You must be signed in to change notification settings - Fork 24.8k
[PyTorch] Make c10::irange(x) generate the same assembly as for loop #86841
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
Conversation
`c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86841
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit 3ec4c55: The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
`c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) ghstack-source-id: 170212610 Pull Request resolved: #86841
@swolchok - Thanks for this. Since |
#85969 is the PR we are blocked on here. |
…s for loop" `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
Pull Request resolved: #86841 `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. ghstack-source-id: 170674298 Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/)
@@ -2889,7 +2889,7 @@ Tensor squeeze_qtensor(const Tensor& self, c10::optional<int64_t> dim) { | |||
const auto* per_channel_quantizer = static_cast<at::PerChannelAffineQuantizer*>(quantizer.get()); | |||
auto axis = per_channel_quantizer->axis(); | |||
int64_t shift = 0; | |||
integer_range<int64_t> dims = dim.has_value() ? integer_range<int64_t>{dim.value(), dim.value() + 1} : c10::irange(self.dim()); | |||
integer_range<int64_t> dims = dim.has_value() ? integer_range<int64_t>{dim.value(), dim.value() + 1} : c10::irange(0, self.dim()); |
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.
Is this a test artefact?
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.
No, it's necessary for the two forks of the ?: operator to have the same type.
@pytorchbot merge -g |
Merge startedYour change will be merged once all checks on your PR pass since you used the green (-g) flag (ETA: 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: This PR is too stale; the last push date was more than 3 days ago. Please rebase and try again. You can rebase by leaving the following comment on this PR: Details for Dev Infra teamRaised by workflow job |
@pytorchbot rebase |
@pytorchbot successfully started a rebase job. Check the current status here |
…s for loop" `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
Successfully rebased |
This PR needs a labelIf your changes are user facing and intended to be a part of release notes, please use a label starting with If not, please add the For more information, see https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work. |
…s for loop" `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
Pull Request resolved: #86841 `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. ghstack-source-id: 171748565 Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/)
@pytorchbot merge -g |
Merge startedYour change will be merged once all checks on your PR pass since you used the green (-g) flag (ETA: 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: The following mandatory check(s) failed (Rule Dig deeper by viewing the failures on hud Details for Dev Infra teamRaised by workflow job |
@pytorchbot rebase |
…s for loop" `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
Successfully rebased |
…s for loop" `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
Pull Request resolved: #86841 `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. ghstack-source-id: 171748565 Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/)
@pytorchbot merge -g |
Merge startedYour change will be merged once all checks on your PR pass since you used the green (-g) flag (ETA: 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: The following mandatory check(s) failed (Rule Dig deeper by viewing the failures on hud Details for Dev Infra teamRaised by workflow job |
@pytorchbot rebase |
@pytorchbot successfully started a rebase job. Check the current status here |
…s for loop" `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
Successfully rebased |
Pull Request resolved: #86841 `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. ghstack-source-id: 02f4028 Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/)
@pytorchbot merge -g |
…s for loop" `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) [ghstack-poisoned]
Pull Request resolved: #86841 `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. ghstack-source-id: 172194311 Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/)
If you believe that failures are unrelated to the PR, feel free to merge it with |
failure definitely looks unrelated |
@pytorchbot merge -f |
❌ 🤖 pytorchbot command failed:
Try |
@pytorchbot merge -f 1 failure that sure looks unrelated |
❌ 🤖 pytorchbot command failed:
Try |
@pytorchbot merge -f '1 failure that sure looks unrelated' |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ytorch#86841) `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) Pull Request resolved: pytorch#86841 Approved by: https://github.com/r-barnes, https://github.com/malfet
…ytorch#86841) `c10::irange(n)` generated an extra `sar` and `andn` instruction compared to a traditional `for` loop. now it doesn't. Differential Revision: [D40321009](https://our.internmc.facebook.com/intern/diff/D40321009/) Pull Request resolved: pytorch#86841 Approved by: https://github.com/r-barnes, https://github.com/malfet
Stack from ghstack (oldest at bottom):
c10::irange(n)
generated an extrasar
andandn
instruction compared to a traditionalfor
loop. now it doesn't.Differential Revision: D40321009