Skip to content

Add missing Buck deps for TOSA dialect real_impl#20642

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
rascani:export-D110214945
Jun 30, 2026
Merged

Add missing Buck deps for TOSA dialect real_impl#20642
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
rascani:export-D110214945

Conversation

@rascani

@rascani rascani commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary:
Adds the two missing third-party Buck deps to the //executorch/backends/arm/tosa/dialect:core target so the Arm TOSA dialect imports under Buck again. This is a stacked follow-up fix for D110150349.

D110150349 added real_impl.py to the srcs of the core target. real_impl.py imports tosa_reference_model and tosa_serializer at module top level, but the target deps were not updated to provide them. Because ops_registration.py now imports real_impl unconditionally, and every TOSA op module imports from ops_registration, the entire Arm TOSA dialect fails to import under Buck. This cascades into every downstream consumer that touches the Arm lowering path.

The import works in OSS (where the deps come from pip/CMake) but breaks under Buck, where third-party deps must be declared explicitly. The fix adds them to the core target:

  • fbsource//third-party/tosa_tools:serializer
  • fbsource//third-party/tosa_tools:tosa_reference_model

Differential Revision: D110214945

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell

Summary:
Adds the two missing third-party Buck deps to the `//executorch/backends/arm/tosa/dialect:core` target so the Arm TOSA dialect imports under Buck again. This is a stacked follow-up fix for D110150349.

D110150349 added `real_impl.py` to the `srcs` of the `core` target. `real_impl.py` imports `tosa_reference_model` and `tosa_serializer` at module top level, but the target `deps` were not updated to provide them. Because `ops_registration.py` now imports `real_impl` unconditionally, and every TOSA op module imports from `ops_registration`, the entire Arm TOSA dialect fails to import under Buck. This cascades into every downstream consumer that touches the Arm lowering path.

The import works in OSS (where the deps come from pip/CMake) but breaks under Buck, where third-party deps must be declared explicitly. The fix adds them to the `core` target:
- `fbsource//third-party/tosa_tools:serializer`
- `fbsource//third-party/tosa_tools:tosa_reference_model`

Differential Revision: D110214945
@rascani rascani requested a review from digantdesai as a code owner June 30, 2026 18:23
@pytorch-bot

pytorch-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20642

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 2968db8 with merge base e095c57 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 30, 2026
@meta-codesync

meta-codesync Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@rascani has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110214945.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot merged commit d4dd644 into pytorch:main Jun 30, 2026
504 of 509 checks passed
rascani added a commit that referenced this pull request Jul 1, 2026
…-land)" (#20670)

Reverts #20537

This breaks some internal tests due to missing BUCK dependencies on the
tosa reference model. I tried to fix forward by just adding those deps
(#20642), but it looks like we'll need to do lazy imports here due to
some binary size expansion. I'll tackle the reland.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils
@Sebastian-Larsson @robell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants