Skip to content

Register quantized out variants for the test_passes target - #24347

Merged
psiddh merged 1 commit into
pytorch:mainfrom
psiddh:export-D128621515
Oct 30, 2026
Merged

psiddh merged 1 commit into
pytorch:mainfrom
psiddh:export-D128621515

Conversation

@psiddh

@psiddh psiddh commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
test_skipped_conv_keeps_its_weight_dequantize_on_cpu, added by the diff-train
import in D128333373 (#23915), is land-blocking with:

RuntimeError: Missing out variants: {'quantized_decomposed::dequantize_per_channel'}

It is the first test in test_passes.py that both leaves a
quantized_decomposed.dequantize_per_channel node on CPU and then calls
edge.to_executorch(). The out-variant pass resolves dequantize_per_channel.out
through the AOT operator registry. QnnQuantizer populates that registry by
importing executorch.kernels.quantized, which torch.ops.load_librarys a
quantized_ops_aot_lib shipped in the pip package; under Buck no such library is
on disk, the import fails, and quantizer.py swallows it into a logging.info.
That is why the test is green on GitHub and red here, and why only the
emit=True case fails while its emit=False sibling passes.

The imported partitioner change is not at fault: every graph assertion in the
test passes, and the failure is at the emission step alone.

Preload //executorch/kernels/quantized:custom_ops_generated_lib so those out
variants are registered, as the comparable python_test targets under
exir/tests, backends/arm and backends/nxp already do. No Python change, so
fbcode stays a faithful copy of the upstream commit.

Guarded on runtime.is_oss, like the other internal-only deps in this file. The
OSS test-qnn-buck-build-linux job runs buck2 build //backends/qualcomm/...,
which builds this target's PAR and would resolve preload_deps;
custom_ops_generated_lib needs :quantized_operators_aten, which
get_aten_mode_options() defines only in aten mode, so unguarded this would
break that signal. Nothing is lost: that job only builds, never runs, and the OSS
pytest path gets the registration from the import above.

Reviewed By: JacobSzwejbka

Differential Revision: D128621515

cc @cbilgin

Summary:
`test_skipped_conv_keeps_its_weight_dequantize_on_cpu`, added by the diff-train
import in D128333373 (pytorch#23915), is land-blocking with:

  RuntimeError: Missing out variants: {'quantized_decomposed::dequantize_per_channel'}

It is the first test in `test_passes.py` that both leaves a
`quantized_decomposed.dequantize_per_channel` node on CPU and then calls
`edge.to_executorch()`. The out-variant pass resolves `dequantize_per_channel.out`
through the AOT operator registry. `QnnQuantizer` populates that registry by
importing `executorch.kernels.quantized`, which `torch.ops.load_library`s a
`quantized_ops_aot_lib` shipped in the pip package; under Buck no such library is
on disk, the import fails, and `quantizer.py` swallows it into a `logging.info`.
That is why the test is green on GitHub and red here, and why only the
`emit=True` case fails while its `emit=False` sibling passes.

The imported partitioner change is not at fault: every graph assertion in the
test passes, and the failure is at the emission step alone.

Preload `//executorch/kernels/quantized:custom_ops_generated_lib` so those out
variants are registered, as the comparable `python_test` targets under
`exir/tests`, `backends/arm` and `backends/nxp` already do. No Python change, so
`fbcode` stays a faithful copy of the upstream commit.

Guarded on `runtime.is_oss`, like the other internal-only deps in this file. The
OSS `test-qnn-buck-build-linux` job runs `buck2 build //backends/qualcomm/...`,
which builds this target's PAR and would resolve `preload_deps`;
`custom_ops_generated_lib` needs `:quantized_operators_aten`, which
`get_aten_mode_options()` defines only in aten mode, so unguarded this would
break that signal. Nothing is lost: that job only builds, never runs, and the OSS
pytest path gets the registration from the import above.

Reviewed By: JacobSzwejbka

Differential Revision: D128621515
Copilot AI balanced review requested due to automatic review settings October 30, 2026 16:53
@pytorch-bot

pytorch-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 6 Pending

As of commit 2643808 with merge base 6c7b213 (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 Oct 30, 2026
@meta-codesync

meta-codesync Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@JacobSzwejbka JacobSzwejbka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@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.

@psiddh psiddh added the module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ label Oct 30, 2026
@psiddh
psiddh merged commit caeb58b into pytorch:main Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants