Commit b0eba38
Arm backend: Add PrintGraphModuleCodePass (#15774)
Inspecting a module between passes that operate on it is often useful
for debugging purposes. This patch adds a pass called
`PrintGraphModuleCodePass` that prints the graph module's code in its
current state. Compared to the already existing `VisualizePass`,
`PrintGraphModuleCodePass` enables quicker feedback when the module is
small enough to be visualized in a text-based print.
Example output from the pass:
```
[arm_pass_manager.py:305]
def forward(self, x, y):
x, y, = fx_pytree.tree_flatten_spec(([x, y], {}), self._in_spec)
remainder = torch.ops.aten.remainder.Scalar(x, 0.25); x = None
return pytree.tree_unflatten((remainder,), self._out_spec)
```
cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai
Signed-off-by: Martin Lindström <Martin.Lindstroem@arm.com>
Co-authored-by: Martin Lindström <Martin.Lindstroem@arm.com>
Co-authored-by: Zingo Andersen <zingo.andersen@arm.com>1 parent 0bb9d18 commit b0eba38
1 file changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments