-
Notifications
You must be signed in to change notification settings - Fork 129
Add necessary lowerings and decompositions to run adaptive_avg_pool2d #1121
Conversation
As per title. [ghstack-poisoned]
…_avg_pool2d" As per title. [ghstack-poisoned]
|
Done! |
…_avg_pool2d" As per title. [ghstack-poisoned]
|
It would be good to have a test for |
torchinductor/decomposition.py
Outdated
| aten.expand_as, | ||
| aten.flip, | ||
| aten.floor_divide.default, | ||
| aten.fmod.Tensor, |
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.
even though nominally we have fmod decomposition, attempting to use it leads to
def forward(self, arg0_1, arg1_1):
fmod = torch.ops.prims.fmod.default(arg0_1, arg1_1); arg0_1 = arg1_1 = None
return (fmod,)
torchinductor.graph: [WARNING] Creating implicit fallback for:
target: prims.fmod.default
args[0]: TensorBox(StorageBox(
InputBuffer(name='arg0_1', layout=FixedLayout('cuda', torch.int32, size=[s0], stride=[1]))
))
args[1]: TensorBox(StorageBox(
InputBuffer(name='arg1_1', layout=FixedLayout('cuda', torch.int32, size=[s0], stride=[1]))
))
torchinductor.ir: [WARNING] Using FallbackKernel: torch.ops.prims.fmod.default
(because decomposition just calls directly into prim)
so again we'd either have to write a real decomposition on the pytorch side, or lowering on the inductor side to support fmod.
Libdevice has fmod, there's also std::fmod so we should just add lowering
…_avg_pool2d" As per title. [ghstack-poisoned]
|
Done. I also added some tests. For signbit, there was no equivalent triton function, so I added an implementation. The implementation is not 100% correct, as it would return |
…_avg_pool2d" As per title. [ghstack-poisoned]
…_avg_pool2d" As per title. [ghstack-poisoned]
…_avg_pool2d" As per title. [ghstack-poisoned]
|
The error seems unrelated |
…_avg_pool2d" As per title. [ghstack-poisoned]
|
Ok, this PR had the same issue as described here #1120 (comment). Please tell me if I need to do anything on my side to fix this. |
Stack from ghstack:
As per title.