Support quantization in Dynamo, ONNX and ET exporters - #47747
Support quantization in Dynamo, ONNX and ET exporters#47747IlyasMoutawwakil wants to merge 10 commits into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
Skimmed it, and looks nice for PT2E flow, I will properly review once you are ready. What is our plan to support eager mode or pre export quantization - I guess through 'HfQuantizer's classes? |
can you elaborate what you mean please 🙏 |
stevhliu
left a comment
There was a problem hiding this comment.
hope you don't mind my review! very well-structured docs though 🤗
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
| Mirror `to_edge_transform_and_lower_to_qnn` for QNN; every other backend uses the plain path. | ||
| """ | ||
| if backend == "qnn": | ||
| from executorch.backends.qualcomm._passes.qnn_pass_manager import QnnPassManager |
There was a problem hiding this comment.
These imports reach into ExecuTorch's internal QNN impl:
_from executorch.backends.qualcomm.passes.qnn_pass_manager import QnnPassManager
_passes is underscore-marked internal and not a stable API — and it's actively churning: pytorch/executorch#20738. Hand-wiring
QnnPassManager.transform_for_export_pipeline() +get_to_edge_transform_passes() here will break as that migration series lands.
(Also, this PR patches _passes.replace_inf_values.ReplaceInfValues, already deleted from ET main: see pytorch/executorch#19660.)
Since #20738 is consolidating QNN pass execution into the standard to_edge_transform_and_lower flow, could the exporter integrate the way every other backend does?
edge = to_edge_transform_and_lower(
programs, partitioner=[QnnPartitioner(compiler_specs)], compile_config=...
)
What do you think?
The generic config.quantizer hook, added as part of this PR is awesome , backend-agnostic, touches zero QNN internals
There was a problem hiding this comment.
yes we can remove them once these fixes/patches are released, that's the plan
CI recapDashboard: View test results in Grafana |
What does this PR do?
Fixes # (issue)
Code Agent Policy
The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. These often are low-quality, or fix extremely minor issues that occur rarely or never in practice.
As a result, we're instituting a rule that first-time contributors should not use code agents to submit PRs or issues.
We'd also ask autonomous "OpenClaw"-like agents not to open any PRs or issues.
Issues/PRs from first-time contributors that violate this rule will probably just be closed without review, and we
might block you, especially if you open more than one or appear to be deliberately ignoring this. We especially do not
want new contributors to jump in on random issues to contribute an agent-written fix. This creates lots of noise
for reviewers and other users and will almost certainly get you blocked.
For more information, please read
CONTRIBUTING.md.Before submitting
Pull Request checks?
to it if that's the case.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.