Arm backend: Lower grid_sampler_2d to VGF TOSA CUSTOM#19547
Open
bdemirb wants to merge 4 commits into
Open
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19547
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit b0c25a2 with merge base 4469d84 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Collaborator
Author
|
@pytorchbot label "partner: arm" |
Collaborator
Author
|
@pytorchbot label "release notes: arm" |
Collaborator
|
Hi @digantdesai this one is probably good to tests internally at Meta :) |
digantdesai
reviewed
May 13, 2026
digantdesai
reviewed
May 13, 2026
Contributor
|
@digantdesai has imported this pull request. If you are a Meta employee, you can view this in D105009413. |
271a05b to
1020f0f
Compare
Collaborator
|
Hi @digantdesai did the internal testing work? This also need a re-import after a small update. |
digantdesai
reviewed
May 20, 2026
Contributor
|
Can you please rebase? |
added 4 commits
June 1, 2026 18:47
This patch builds on the preceding Arm TOSA custom-op infrastructure changes in Gerrit changes 1222279, 1222280, and 1222278. On top of that base, it adds the first concrete use case for grid_sampler_2d by preserving aten.grid_sampler_2d through partitioning and rewriting it in the Arm lowering pipeline to tosa.CUSTOM instead of decomposing it into a large standard TOSA subgraph. The lowering attaches CustomAttribute metadata carrying a placeholder shader payload in implementation_attrs, adjusts the fake tosa.CUSTOM op to behave as a single-output tensor op so it composes correctly with the existing Arm TOSA pipeline, and adds a focused regression test showing that a torch.nn.functional.grid_sample model lowers successfully and produces exactly one CUSTOM op in the serialized TOSA graph. Signed-off-by: Baris Demir <baris.demir@arm.com> Change-Id: I183afd344715e38f613db89ad8945060df7f2f1f
Refactor the grid_sampler_2d TOSA CUSTOM payload into a helper module so the custom shader contract, constants, and validation logic live in one place. Emit the ML SDK Vulkan custom-shader attribute format, including the converter-recognized domain, entry point, workgroup sizes, shader language/code, tensor storage-buffer bindings, descriptor sets, and Vulkan format metadata. Add focused tests for payload round-trip behavior and for the grid_sampler_2d rewrite pass. Signed-off-by: Baris Demir <baris.demir@arm.com> Change-Id: I8f13f91b97e86b3b32bf2c25479684bc09faeddc
Add a VGF export/integration test for grid_sampler using the existing VgfPipeline. The test is gated on model-converter availability and runs with quantization disabled and Vulkan runtime execution disabled, so it validates the converter/export handoff without depending on runtime shader dispatch. Also register grid_sampler as a recognized custom edge op for the Arm test-name validator. Signed-off-by: Baris Demir <baris.demir@arm.com> Change-Id: I495d4283b09de7dedebce5d2f24b240e79d37dfc
Change-Id: Iae92c23da049949f5f1d0719922d84581893d4f7
288e48f to
b0c25a2
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani