-
Notifications
You must be signed in to change notification settings - Fork 753
Adding Test For CadenceWith16BitLinearActivationsQuantizer #16097
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16097
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 2085907 with merge base 3a76a8b ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: hsharma35 Differential Revision: D88054651
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive unit tests for the CadenceWith16BitLinearActivationsQuantizer and CadenceWith16BitMatmulActivationsQuantizer classes. The tests verify that these quantizers correctly annotate graph nodes with 16-bit quantization specifications (INT16 for activations, INT8 for weights).
Key Changes:
- Adds a new test class
QuantizerAnnotationTestwith helper methods to build test graphs - Tests 16-bit quantizer annotations for both matmul and linear operations
- Updates TARGETS file with necessary dependencies for the new tests
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| backends/cadence/aot/tests/test_quantizer_ops.py | Adds QuantizerAnnotationTest class with tests for 16-bit quantizer annotations on matmul and linear operations |
| backends/cadence/aot/TARGETS | Adds dependencies for graph_builder, pass_base, and torchao modules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
|
|
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test should verify that all inputs in input_qspec_map are expected. Currently, if an unexpected input node appears that doesn't match linear_node.args[0] or linear_node.args[1], the test will silently pass without checking its qspec. Consider adding an else clause with a self.fail() to catch unexpected inputs:
for input_node, input_qspec in annotation.input_qspec_map.items():
if input_node == linear_node.args[0]:
# Activation input - should be INT16
self.assertEqual(input_qspec, qconfig_A16.input_activation)
elif input_node == linear_node.args[1]:
# Weight - should be INT8
self.assertEqual(input_qspec, qconfig_A16.weight)
else:
self.fail(f"Unexpected input node in input_qspec_map: {input_node}")| else: | |
| self.fail(f"Unexpected input node in input_qspec_map: {input_node}") |
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
e155ee0 to
60073c7
Compare
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
60073c7 to
e4ad6f0
Compare
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
e4ad6f0 to
6dddd2f
Compare
…6089) Summary: We test the quantizer we added in D87996796 correctly annotates the graph. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88053808
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
6dddd2f to
2085907
Compare
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
…6097) Summary: We test the CadenceWith16BitLinearActivationQuantizer. We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected. Reviewed By: zonglinpeng, hsharma35 Differential Revision: D88054651
Summary:
We test the CadenceWith16BitLinearActivationQuantizer.
We use the graph builder to build the graph with metadata(that's needed for quantizer.annotate to recognize the nodes), and we ensure that the quantization params are as expected.
Reviewed By: hsharma35
Differential Revision: D88054651