(graph: Graph, quant_config: QuantizationConfig)
| 30 | |
| 31 | |
| 32 | def annotate(graph: Graph, quant_config: QuantizationConfig) -> None: |
| 33 | # Pattern annotation |
| 34 | _annotate_rmsnorm_pattern(graph, quant_config) |
| 35 | _annotate_fused_activation_pattern(graph, quant_config) |
| 36 | |
| 37 | # Per-op annotation |
| 38 | for node in graph.nodes: |
| 39 | if node.op == "placeholder": |
| 40 | annotate_placeholder(node, quant_config) |
| 41 | elif node.op == "call_function": |
| 42 | annotate_func = OP_TO_ANNOTATOR.get(node.target, None) |
| 43 | if annotate_func is not None: |
| 44 | annotate_func(node, quant_config) |
| 45 | |
| 46 | |
| 47 | def register_annotator(ops: List[OpOverload]): |
no test coverage detected