Clean up executorch type checking setup (#21719) - #21793
Conversation
Summary: `fbcode/executorch/PACKAGE` carried a `python.set_pyrefly(False)` opt-out. Remove it so executorch inherits `python.set_pyrefly(True)` from the fbcode root. Removing the opt-out on its own would have flipped 43 targets from classic Pyre onto Pyrefly and surfaced real type errors (nullability on `mem_id` / `mem_offset` in `test_memory_passes.py`, `tuple[SourcePartition, ...]` vs `list[GraphModule]` in `quantizer.py`, a missing `PassResult` return, and others). Every one of those targets is in open-source code. executorch syncs to the open-source `pytorch/executorch` repo, which is why the root already sets `python.set_typing(False)` — suppressions added here leak into OSS and break OSS CI on checker upgrades. That policy was being undercut by 43 target-level `typing = True` attributes outside the internal `fb/` subtrees, and those overrides were the *only* thing pulling OSS files into type checking. So rather than write Pyrefly suppressions into OSS-synced files, drop the overrides and let the package-level `set_typing(False)` stand. Internal `fb/` code is untouched: the 66 typed targets under `examples/models/fb/` were already on Pyrefly via `examples/models/fb/PACKAGE` and stay type-checked, now by inheritance from the fbcode root. Note for reviewers: `backends/cadence` loses the Pyre coverage it had. That is the intended trade — it is OSS-synced, and its errors cannot be suppressed in-tree without leaking into the public repo — but it is a coverage reduction that should be an explicit owner decision, not an auto-accept. The `typing_stubs` target in `backends/cadence/aot/BUCK` and its dep references are left intact. Reviewed By: shobhitmehro Differential Revision: D115454520
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21793
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit a19e087 with merge base 3b5bf0f ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@maggiemoss has exported this pull request. If you are a Meta employee, you can view the originating Diff in D115454520. |
|
@pytorchbot label "release notes: none" |
There was a problem hiding this comment.
Pull request overview
This PR updates ExecuTorch Buck/Starlark build targets to stop opting open-source-synced Python code into type checking by removing per-target typing = True overrides, so typing behavior can be controlled by package-/repo-level defaults.
Changes:
- Removed
typing = Truefrom multiplefbcode_target(...)/runtime.python_library(...)definitions across Vulkan, Native, Test, and Cadence backend build targets. - Kept the Cadence
typing_stubstarget and dependency wiring intact while disabling type checking for the surrounding OSS-synced targets.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backends/vulkan/patterns/BUCK | Removes typing = True from Vulkan patterns python library target. |
| backends/vulkan/partitioner/BUCK | Removes typing = True from Vulkan partitioner python library target. |
| backends/vulkan/_passes/targets.bzl | Removes typing = True from Vulkan passes target definition. |
| backends/test/targets.bzl | Removes typing = True from shared test builder python libraries. |
| backends/native/BUCK | Removes typing = True from the Native backend python library target. |
| backends/cadence/utils/targets.bzl | Removes typing = True from Cadence utility python library target. |
| backends/cadence/runtime/BUCK | Removes typing = True from Cadence runtime python library target. |
| backends/cadence/aot/quantizer/passes/BUCK | Removes typing = True from Cadence quantizer passes python library target. |
| backends/cadence/aot/quantizer/BUCK | Removes typing = True from Cadence quantizer-related python library targets. |
| backends/cadence/aot/BUCK | Removes typing = True from multiple Cadence AOT python library and python_unittest targets (including typing_stubs). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| fbcode_target(_kind = runtime.python_library, | ||
| name = "ref_implementations", | ||
| srcs = [ | ||
| "ref_implementations.py", | ||
| ], |
There was a problem hiding this comment.
this is intentional as typing = True is an outdated way to enable this.
Summary:
Removing the typing = True from these buck files to clear the way for a more stable, easy to configure type checking set up
Reviewed By: shobhitmehro
Differential Revision: D115454520