Add QAT support and pass hooks to QuantizationRecipe. - #21935
Open
MartinPavella wants to merge 1 commit into
Open
Add QAT support and pass hooks to QuantizationRecipe.#21935MartinPavella wants to merge 1 commit into
MartinPavella wants to merge 1 commit into
Conversation
MartinPavella
requested review from
JakeStevens,
novak-vaclav,
pytorchbot,
rascani,
robert-kalmar and
roman-janik-nxp
August 19, 2026 08:09
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21935
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled JobAs of commit 538a19c with merge base bea0657 ( CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This PR needs a
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend
QuantizationRecipewith QAT support and four ordered pass hooks, then wire them intoQuantizeStage.QuantizationRecipegainsis_qat,train_fn,calibration_inputs_fn, and four pass-list fields (pre_prepare_passes,post_prepare_passes,pre_convert_passes,post_convert_passes). Whenis_qat=True,QuantizeStagecallsprepare_qat_pt2einstead ofprepare_pt2e, invokestrain_fnon the prepared model, and skips calibration. Whenis_qat=False(default), PTQ proceeds as before, but callers may now supply acalibration_inputs_fnto supply their own calibration data. If omitted, the existing example-inputs fallback is used. The four pass hooks are applied at the appropriate points in both flows and compose cleanly with_combine_recipes._combine_recipesis overhauled to handle all previously dropped fields: the four pass lists are concatenated,is_qatmust agree across all combined recipes, at most onetrain_fnis allowed, and multiplecalibration_inputs_fnvalues are chained into a single factory. Thestrict,mode,pipeline_stages, andsource_transform_in_placescalar fields are now also validated for agreement and propagated to the combined recipe.edge_manager_transform_passesfromLoweringRecipeis similarly merged.Test Plan