-
Notifications
You must be signed in to change notification settings - Fork 827
Metal backend: enable quantization in test_modules #17118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
manuelcandales
wants to merge
6
commits into
gh/manuelcandales/154/head
Choose a base branch
from
gh/manuelcandales/155/head
base: gh/manuelcandales/154/head
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Metal backend: enable quantization in test_modules #17118
manuelcandales
wants to merge
6
commits into
gh/manuelcandales/154/head
from
gh/manuelcandales/155/head
+160
−14
Conversation
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
Contributor
Author
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17118
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 2 Unrelated FailuresAs of commit fec15bc with merge base ba6de95 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Feb 2, 2026
This was referenced Feb 4, 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.
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.
This pull request adds support for quantized model testing (specifically int4 quantization) to the Metal backend module tests, using torchao. It introduces the ability to specify quantization options in the module registry, applies quantization to linear layers as needed, and updates the testing pipeline to compare quantized models against unquantized references when appropriate. A new test model with int4 quantization is also added.
Quantization Support and Configuration:
qlinear,qlinear_group_size,compare_to_unquantized) and how to use them for int4 quantization.Test Model and Registry Enhancements:
LinearNoBiasInt4, a linear layer test model without bias and with int4 quantization, and registered it inMODULE_REGISTRYwith appropriate quantization and tolerance settings.Quantization Application Logic:
get_model_and_inputsto accept quantization arguments, apply quantization to models as specified in the registry, and added thequantize_modelhelper to perform quantization using torchao. [1] [2]Testing Pipeline Updates:
export_model_to_filesto optionally compare quantized model outputs to unquantized references, handling device placement and ensuring correct output computation for quantized models.