Skip to content

Add backward compatible types to pt2e prepare (#2244) #11080

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

Merged
merged 1 commit into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/cadence/aot/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def prepare_and_convert_pt2(
assert isinstance(model_gm, torch.fx.GraphModule)

# Prepare
prepared_model = prepare_pt2e(model_gm, quantizer) # pyre-ignore[6]
prepared_model = prepare_pt2e(model_gm, quantizer)

# Calibrate
# If no calibration data is provided, use the inputs
Expand Down
2 changes: 1 addition & 1 deletion examples/xnnpack/quantization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def quantize(
is_dynamic=is_dynamic,
)
quantizer.set_global(operator_config)
m = prepare_pt2e(model, quantizer) # pyre-ignore[6]
m = prepare_pt2e(model, quantizer)
# calibration
m(*example_inputs)
m = convert_pt2e(m)
Expand Down
2 changes: 1 addition & 1 deletion extension/llm/export/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def pt2e_quantize(self, quantizers: Optional[List[Quantizer]]) -> "LLMEdgeManage
), "Please run export() first"
m = prepare_pt2e(
self.pre_autograd_graph_module, # pyre-ignore[6]
composed_quantizer, # pyre-ignore[6]
composed_quantizer,
)
logging.info(
f"Calibrating with tasks: {self.calibration_tasks}, limit: {self.calibration_limit}, calibration_data: {self.calibration_data}, tokenizer_path: {self.tokenizer_path}, seq_length: {self.calibration_seq_length}"
Expand Down
Loading