You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.`_passes/utils.py` — add to `get_passes_dependency_for_capture_program()` with `[RemoveRedundancy]` dependency
220
+
2.`_passes/qnn_pass_manager.py` — The pass manager uses classmethods for pipeline definitions:
221
+
-**Import** — add to the import block at top of file
222
+
-**`get_annotation_passes()`** — add pass class to the returned list (runs before quantizer, ATen IR)
223
+
-**`get_export_passes()`** — add pass class if needed for float-only path (runs after quantization, before to-edge)
224
+
-**`get_default_pass_activations()`** — add `(PassClass, True)` ONLY if the pass also needs to run in the to-edge pipeline
225
+
-**`get_passes_dependency_for_capture_program()`** — add `PassClass: [RemoveRedundancy]` dependency ONLY if also in `get_default_pass_activations`
226
+
227
+
**When to add to which pipeline:**
228
+
-**Annotation only** (most common for decompose passes): `get_annotation_passes()` — pass decomposes the op before the quantizer sees it
229
+
-**Export pipeline** too: if the float-only test fails without it (op doesn't get handled by PyTorch's built-in decomposition during to-edge)
230
+
-**Capture program** (to-edge) too: if the op can appear in edge dialect and needs decomposition there (e.g., `DecomposeVar`, `DecomposeCDist`, `DecomposeDiagonal`)
222
231
223
232
---
224
233
@@ -255,4 +264,4 @@ class DecomposeMyOp(ExportPass):
0 commit comments