Skip to content
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

PT2E QAT Move model to eval before convert #2977

Closed
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
6 changes: 3 additions & 3 deletions prototype_source/pt2e_quant_x86_inductor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ The PyTorch 2 Export QAT flow is largely similar to the PTQ flow:

# train omitted

converted_model = convert_pt2e(prepared_model)
# we have a model with aten ops doing integer computations when possible

# move the quantized model to eval mode, equivalent to `m.eval()`
torch.ao.quantization.move_exported_model_to_eval(converted_model)

converted_model = convert_pt2e(prepared_model)
# we have a model with aten ops doing integer computations when possible

# Lower the model into Inductor
with torch.no_grad():
optimized_model = torch.compile(converted_model)
Expand Down
Loading