Reland "Arm backend: Add real implementation for TOSA dialect ops (re-land)" v2 (#20674)#20674
Reland "Arm backend: Add real implementation for TOSA dialect ops (re-land)" v2 (#20674)#20674rascani wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20674
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 7 PendingAs of commit 08f8c84 with merge base 3bd4748 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@rascani has imported this pull request. If you are a Meta employee, you can view this in D110362915. |
…-land)" v2 (#20674) Summary: Reverts #20670 and relands #20537 In a first commit, Arm backend: Add infra for real implementations of Tosa ops Tested by applying the infra to the avg_pool2d Tosa dialect op. The rewrite_avg_pool2d tests can now be ran to verify that the produced Tosa is correct. To make it completely correct, two additional passes need to be added to the test. Then, Arm backend: Add real impls to all TOSA dialect ops Additionally, Remove special case in ComputeOpsAOT pass for such ops, since they can now be executed. Start running the model in tests were this was previously impossible due to ops not having a real impl. Pull Request resolved: #20674 Differential Revision: D110362915 Pulled By: rascani
d87e5e5 to
08f8c84
Compare
|
@rascani has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110362915. |
| # Import lazily: the reference model is only needed to execute an op, | ||
| # not to import the dialect. Linking the native extension into every | ||
| # dialect consumer overflows the ELF relocation limit in large builds. | ||
| import tosa_reference_model as reference_model # type: ignore[import-not-found, import-untyped] | ||
| import tosa_serializer as ts |
There was a problem hiding this comment.
fyi @Erik-Lundell - this is the only non-BUCK change.
There was a problem hiding this comment.
Sounds good. Makes the dialect less sensitive to missing the tosa-tools dependency as well.
Erik-Lundell
left a comment
There was a problem hiding this comment.
Tough one to land... LGTM, thanks for fixing
| # Import lazily: the reference model is only needed to execute an op, | ||
| # not to import the dialect. Linking the native extension into every | ||
| # dialect consumer overflows the ELF relocation limit in large builds. | ||
| import tosa_reference_model as reference_model # type: ignore[import-not-found, import-untyped] | ||
| import tosa_serializer as ts |
There was a problem hiding this comment.
Sounds good. Makes the dialect less sensitive to missing the tosa-tools dependency as well.
Summary:
Reverts #20670 and relands #20537
In a first commit,
Arm backend: Add infra for real implementations of Tosa ops
Tested by applying the infra to the avg_pool2d Tosa dialect op.
The rewrite_avg_pool2d tests can now be ran to verify that
the produced Tosa is correct. To make it completely correct,
two additional passes need to be added to the test.
Then,
Arm backend: Add real impls to all TOSA dialect ops
Additionally,
Remove special case in ComputeOpsAOT pass for such ops,
since they can now be executed.
Start running the model in tests were this was previously
impossible due to ops not having a real impl.
Differential Revision: D110362915
Pulled By: rascani