8
8
from executorch import exir
9
9
from executorch .backends .nxp .neutron_partitioner import NeutronPartitioner
10
10
from executorch .backends .nxp .nxp_backend import generate_neutron_compile_spec
11
-
12
- # TODO (Robert Kalmar) Uncomment when NXP passes are ported to main
13
- # from executorch.backends.nxp.pytorch_passes.nxp_pytorch_pass_manager import NXPPyTorchPassManager
14
11
from executorch .backends .nxp .quantizer .neutron_quantizer import NeutronQuantizer
15
12
from executorch .exir import (
16
13
EdgeCompileConfig ,
@@ -27,7 +24,7 @@ def _quantize_model(model, calibration_inputs: list[tuple[torch.Tensor]]):
27
24
quantizer = NeutronQuantizer ()
28
25
29
26
m = prepare_pt2e (model , quantizer )
30
- for _i , data in enumerate ( calibration_inputs ) :
27
+ for data in calibration_inputs :
31
28
m (* data )
32
29
m = convert_pt2e (m )
33
30
@@ -48,14 +45,8 @@ def to_quantized_edge_program(
48
45
model , example_input , strict = True
49
46
)
50
47
51
- # TODO(Robert Kalmar) uncoment when NXP passes are ported to main
52
- # Run pre-processing passes of the float32 aten dialect program.
53
- # pass_manager = NXPPyTorchPassManager(exir_program_aten)
54
- # pass_manager.run() # All passes by default.
55
-
56
- exir_program_aten_module = exir_program_aten .module ()
57
48
exir_program_aten__module_quant = _quantize_model (
58
- exir_program_aten_module , calibration_inputs
49
+ exir_program_aten . module () , calibration_inputs
59
50
)
60
51
61
52
compile_spec = generate_neutron_compile_spec (
0 commit comments