MCPcopy Create free account
hub / github.com/pytorch/executorch / NeuropilotQuantizer

Class NeuropilotQuantizer

backends/mediatek/quantizer/quantizer.py:17–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16
17class NeuropilotQuantizer(Quantizer):
18
19 def __init__(self):
20 super().__init__()
21
22 # TODO: Provide setter functions for those attributes
23 self._precision = Precision.A8W8
24 self._is_per_channel = True
25 self._is_qat = False
26
27 def setup_precision(self, precision: Precision) -> None:
28 self._precision = precision
29
30 def transform_for_annotation(self, model: GraphModule) -> GraphModule:
31 model = DecomposeScaledDotProductAttention()(model).graph_module
32 return model
33
34 def annotate(self, model: GraphModule) -> GraphModule:
35 self._annotate(model)
36 return model
37
38 def validate(self, model: GraphModule) -> None:
39 pass
40
41 def _annotate(self, gm: GraphModule) -> None:
42 quant_config = get_quant_config(
43 self._precision, self._is_per_channel, self._is_qat
44 )
45 annotate(gm.graph, quant_config)

Callers 7

build_executorch_binaryFunction · 0.90
export_to_et_irFunction · 0.90
export_to_et_irFunction · 0.90
export_to_et_irFunction · 0.90
export_to_et_irFunction · 0.90
export_encoder_to_et_irFunction · 0.90
export_to_et_irFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected