[PyTorch] Make c10::irange(x) generate the same assembly as for loop - #86841
[PyTorch] Make c10::irange(x) generate the same assembly as for loop#86841swolchok wants to merge 8 commits into
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/)
| 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.
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 |
|
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
…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 extrasarandandninstruction compared to a traditionalforloop. now it doesn't.Differential Revision: D40321009