4747from .utils import print_ops_info
4848
4949
50- # Note: this is not meant as a primary API since it can create inconsistencies
51- # if the quantizer here is different from the quantizer used to convert. It is
52- # however useful for unit tests to separate the converted model from the fused
53- # model, to be able to get reference numerics.
54- # If this does not apply, please use quantize_and_fuse_pt2 instead.
55- def convert_pt2 (
50+ def prepare_and_convert_pt2 (
5651 model : torch .nn .Module ,
5752 inputs : tuple [object , ...],
5853 quantizer : CadenceQuantizer ,
@@ -150,7 +145,7 @@ def quantize_pt2(
150145 dump_graphs : bool = False ,
151146) -> torch .fx .GraphModule :
152147 """
153- Prepare , convert and fuse the model using the given quantizer.
148+ Trace, prepare , convert and fuse the model using the given quantizer.
154149 If calibration data is provided, it will be used to calibrate the model. If
155150 not, the inputs will be used for calibration instead, which is useful for
156151 unit tests but should not be used for end-to-end use cases.
@@ -164,7 +159,7 @@ def quantize_pt2(
164159 quantizer = CadenceDefaultQuantizer ()
165160
166161 # Get converted graph module
167- converted_gm = convert_pt2 (
162+ converted_gm = prepare_and_convert_pt2 (
168163 model , inputs , quantizer , calibration_data , dump_graphs = dump_graphs
169164 )
170165
0 commit comments