Arm backend: block invalid bilinear RESIZE downscale at 1/16#19151
Arm backend: block invalid bilinear RESIZE downscale at 1/16#19151perheld wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19151
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New Failures, 101 PendingAs of commit eb0a0bf with merge base ad2f500 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Pull request overview
This PR tightens Arm backend handling of TOSA bilinear RESIZE by rejecting the invalid boundary downscale ratio of exactly 1/16, and shifts upsample delegation decisions into explicit operator-support checks so the partitioner can correctly gate bilinear upsample cases.
Changes:
- Add dialect-level validation to reject bilinear
RESIZEdownscales with ratio<= 1/16(including exactly1/16). - Move
upsample_{nearest,bilinear}2dsupport from static profile lists into explicit TOSA operator support checks, rejecting the boundary-invalid bilinear case. - Add regression tests for both the dialect
RESIZEvalidation and the end-to-end Arm bilinear interpolate (align_corners=False,scale_factor=1/16) non-delegation behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| backends/arm/tosa/dialect/ops/resize.py | Enforces the bilinear downscale > 1/16 constraint at the dialect fake-op validation level. |
| backends/arm/operator_support/upsample_support.py | Adds explicit TOSA support checks for nearest/bilinear upsample; rejects bilinear cases that would generate invalid TOSA RESIZE scale. |
| backends/arm/operator_support/tosa_profile_supported_op_lists.py | Removes upsample ops from unconditional support lists so conditional gating can be enforced via support checks. |
| backends/arm/operator_support/init.py | Ensures the new upsample support checks are imported/registered. |
| backends/arm/test/misc/test_tosa_dialect_resize.py | Adds regression for dialect-level bilinear RESIZE validation at the 1/16 boundary. |
| backends/arm/test/ops/test_upsample_bilinear2d.py | Adds end-to-end regression ensuring exact 1/16 bilinear downscale does not delegate. |
| backends/arm/test/targets.bzl | Registers the new dialect resize test in the Arm test target list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
That is merged no I restart a rebase to make sure it works |
TOSA bilinear RESIZE requires the downscale ratio to be strictly greater than 1/16. The Arm backend currently accepts the exact 1/16 boundary case and can emit RESIZE parameters that the TOSA reference model rejects. Move upsample operator gating into explicit Arm operator support checks. Keep nearest upsample explicitly supported there, and reject bilinear upsample cases whose computed TOSA RESIZE scale hits the invalid 1/16 boundary. Keep the corresponding validation in the fake TOSA RESIZE op so the dialect-level constraint is still enforced directly. Also add regressions for the dialect-level validation and the end-to-end Arm bilinear interpolate case with align_corners=False and scale_factor=1/16. Signed-off-by: Per Held <per.held@arm.com> Change-Id: I612fc7315fa4d1bd158e2f71bcaa493fcaf08c03
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TOSA bilinear RESIZE requires the downscale ratio to be strictly greater than 1/16. The Arm backend currently accepts the exact 1/16 boundary case and can emit RESIZE parameters that the TOSA reference model rejects.
Move upsample operator gating into explicit Arm operator support checks. Keep nearest upsample explicitly supported there, and reject bilinear upsample cases whose computed TOSA RESIZE scale hits the invalid 1/16 boundary. Keep the corresponding validation in the fake TOSA RESIZE op so the dialect-level constraint is still enforced directly.
Also add regressions for the dialect-level validation and the end-to-end Arm bilinear interpolate case with align_corners=False and scale_factor=1/16.
Change-Id: I612fc7315fa4d1bd158e2f71bcaa493fcaf08c03
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell