Repository navigation
Register quantized out variants for the test_passes target - #24347
Conversation
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
🔗 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 PendingAs of commit 2643808 with merge base 6c7b213 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@psiddh has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128621515. |
JacobSzwejbka
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
This PR needs a
|
Summary:
test_skipped_conv_keeps_its_weight_dequantize_on_cpu, added by the diff-trainimport in D128333373 (#23915), is land-blocking with:
RuntimeError: Missing out variants: {'quantized_decomposed::dequantize_per_channel'}
It is the first test in
test_passes.pythat both leaves aquantized_decomposed.dequantize_per_channelnode on CPU and then callsedge.to_executorch(). The out-variant pass resolvesdequantize_per_channel.outthrough the AOT operator registry.
QnnQuantizerpopulates that registry byimporting
executorch.kernels.quantized, whichtorch.ops.load_librarys aquantized_ops_aot_libshipped in the pip package; under Buck no such library ison disk, the import fails, and
quantizer.pyswallows it into alogging.info.That is why the test is green on GitHub and red here, and why only the
emit=Truecase fails while itsemit=Falsesibling 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_libso those outvariants are registered, as the comparable
python_testtargets underexir/tests,backends/armandbackends/nxpalready do. No Python change, sofbcodestays a faithful copy of the upstream commit.Guarded on
runtime.is_oss, like the other internal-only deps in this file. TheOSS
test-qnn-buck-build-linuxjob runsbuck2 build //backends/qualcomm/...,which builds this target's PAR and would resolve
preload_deps;custom_ops_generated_libneeds:quantized_operators_aten, whichget_aten_mode_options()defines only in aten mode, so unguarded this wouldbreak 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