|
35 | 35 |
|
36 | 36 | from executorch.exir.passes.spec_prop_pass import SpecPropPass
|
37 | 37 | from executorch.exir.serialize import serialize_to_flatbuffer
|
| 38 | +from executorch.exir.tracer import _default_decomposition_table |
38 | 39 |
|
39 | 40 | # pyre-ignore[21]: Could not find module `executorch.extension.pybindings.portable`.
|
40 | 41 | from executorch.extension.pybindings.portable import ( # @manual
|
@@ -312,19 +313,22 @@ def quantize_and_test_model_with_quantizer(
|
312 | 313 | ):
|
313 | 314 | module.eval()
|
314 | 315 | # program capture
|
315 |
| - capture_config = exir.CaptureConfig( |
316 |
| - pt2_mode=True, enable_functionalization=True |
| 316 | + m = torch._export.capture_pre_autograd_graph( |
| 317 | + module, example_inputs, decomp_table=_default_decomposition_table() |
317 | 318 | )
|
318 |
| - captured_program = exir.capture(module, example_inputs, config=capture_config) |
319 |
| - m = captured_program.exported_program.graph_module |
320 | 319 |
|
321 | 320 | quantizer = XNNPACKQuantizer()
|
322 | 321 | quantization_config = get_symmetric_quantization_config()
|
323 | 322 | quantizer.set_global(quantization_config)
|
324 | 323 | prepared = prepare_pt2e(m, quantizer)
|
325 | 324 | converted = convert_pt2e(prepared)
|
326 | 325 |
|
327 |
| - captured_program.exported_program.graph_module = converted |
| 326 | + captured_program = exir.capture( |
| 327 | + converted, |
| 328 | + example_inputs, |
| 329 | + config=exir.CaptureConfig(enable_aot=True, _unlift=True), |
| 330 | + ) |
| 331 | + |
328 | 332 | edge_program = captured_program.to_edge(get_xnnpack_edge_compile_config())
|
329 | 333 | delegated_module = self.lower_module_and_test_output(
|
330 | 334 | module=edge_program,
|
|
0 commit comments