Arm backend: Guard argmax and argmin int32 propagation - #22144
Conversation
Previously, once an argmax or argmin index fit int32, the pass sent every consumer through the int32 path. Later arithmetic could then overflow even though the raw index itself was safe. Keep unsafe direct consumers on the original int64 value. When a safe int32 prefix reaches an unsafe consumer, insert an int64 boundary. This allows preceding safe operations to remain delegatable while keeping calculations correct and model output dtypes unchanged. Cover safe and overflowing paths in both ATen and Edge graphs. Signed-off-by: Måns Nilsson <mans.nilsson@arm.com> Change-Id: I6849f1e33e17ab9661cf25002923e180755e0a46
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22144
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7105b90 with merge base cbcdfc1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
Oh no, Ill try a re-run |
Signed-off-by: Måns Nilsson <mans.nilsson@arm.com> Change-Id: I4cafb654c315f77dab4b80a20de669cb0c161610
Previously, once an argmax or argmin index fit int32, the pass sent every consumer through the int32 path. Later arithmetic could then overflow even though the raw index itself was safe.
Keep unsafe direct consumers on the original int64 value. When a safe int32 prefix reaches an unsafe consumer, insert an int64 boundary. This allows preceding safe operations to remain delegatable while keeping calculations correct and model output dtypes unchanged.
Cover safe and overflowing paths in both ATen and Edge graphs.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @Sebastian-Larsson @robell @rascani