-
Notifications
You must be signed in to change notification settings - Fork 129
Fix operator // for integer inputs #1120
Conversation
Before this was returning floats rather than ints. [ghstack-poisoned]
Before this was returning floats rather than ints. [ghstack-poisoned]
|
What I've seen in PrimTorch is that all the other cc @mruberry |
|
Given that we already have codegen for floordiv, I suggest we just add inductor-specific decomposition instead (it doesn't require signbit and fmod, and also doesn't pull in buggy |
Before this was returning floats rather than ints. [ghstack-poisoned]
Before this was returning floats rather than ints. [ghstack-poisoned]
|
Cool, done. I'm leaving the fix for |
|
Can you add a test for |
Before this was returning floats rather than ints. [ghstack-poisoned]
|
Added the tests. Feel free to merge if they look fine. I also caught an early return in one of the tests (see the last diff). I guess mypy is not run on the tests? @jansel |
|
Hm, I'm not sure ghstack PRs merge correctly, can you redo it without ghstack? |
|
@ngimel You have to use |
|
Do I need to do anything? |
|
I ran |
|
looks like it's on master now to me |
|
Mind to land |
## Context Introduce a core decomposition for `aten.floor_divide` into other `aten` ops, and add it to the core ATen decomposition table. This replaces the decomposition of `floor_divide` that was used by Inductor. I noticed there was a note on that decomposition ``` # TorchInductor-only decomposition. It should not be taken to core. # See pytorch/torchdynamo#1120 ``` but couldn't discern the reason why this is the case. cc: lezcano cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov [ghstack-poisoned]
## Context Introduce a core decomposition for `aten.floor_divide` into other `aten` ops, and add it to the core ATen decomposition table. This replaces the decomposition of `floor_divide` that was used by Inductor. I noticed there was a note on that decomposition ``` # TorchInductor-only decomposition. It should not be taken to core. # See pytorch/torchdynamo#1120 ``` but couldn't discern the reason why this is the case. cc: @lezcano Pull Request resolved: #110046 Approved by: https://github.com/peterbell10
…or_divide" ## Context Introduce a core decomposition for `aten.floor_divide` into other `aten` ops, and add it to the core ATen decomposition table. This replaces the decomposition of `floor_divide` that was used by Inductor. I noticed there was a note on that decomposition ``` # TorchInductor-only decomposition. It should not be taken to core. # See pytorch/torchdynamo#1120 ``` but couldn't discern the reason why this is the case. cc: lezcano cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov [ghstack-poisoned]
## Context Introduce a core decomposition for `aten.floor_divide` into other `aten` ops, and add it to the core ATen decomposition table. This replaces the decomposition of `floor_divide` that was used by Inductor. I noticed there was a note on that decomposition ``` # TorchInductor-only decomposition. It should not be taken to core. # See pytorch/torchdynamo#1120 ``` but couldn't discern the reason why this is the case. cc: lezcano cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov [ghstack-poisoned]
Stack from ghstack:
Before this was returning floats rather than ints.