Skip to content

Commit cc3f250

Browse files
mcremon-metafacebook-github-bot
authored andcommitted
Call eval() in quantize_pt2
Summary: This will make sure ALL calls going through there are in eval mode. In a subsequent diff, all calls will go through `quantize_pt2`, including fp32 cases which will use a nop quantizer and will allow further cleanup of the flow. Differential Revision: D67561642
1 parent 3508421 commit cc3f250

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backends/cadence/aot/compiler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def quantize_pt2(
131131
Prepare, convert and fuse the model using the given quantizer.
132132
Returns a GraphModule with the quantized model.
133133
"""
134-
# Quantizer
134+
# Make the model inference mode by calling model.eval()
135+
model.eval()
136+
137+
# Instantiate the quantizer to CadenceQuantizer if not supplied
135138
if not quantizer:
136139
quantizer = CadenceQuantizer()
137140

0 commit comments

Comments
 (0)