Commit 6f6225c
authored
Arm backend: Split shared get_attr nodes before dedupe (#20420)
DeduplicateGetAttrPass gives duplicate get_attr nodes different backing
attrs before PT2E folding. It missed the case where one get_attr node
has multiple users, for example:
w = get_attr("weight")
conv1 = conv2d(x, w)
conv2 = conv2d(y, w)
Some passes preceding DeduplicateGetAttrPass hid this issue because they
rebuilt the graph through ExportPass. That rebuild could split the
shared get_attr node into one node per use, even when the pass did not
change any operators.
Handle that case in DeduplicateGetAttrPass. Keep the original get_attr
node for the first user, then create new get_attr nodes for the other
users with the same target and copied metadata.
The existing dedupe logic can then give those get_attr nodes different
backing attrs. This keeps shared parameter handling correct without
relying on graph rebuild side effects.
Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>1 parent 59fc93d commit 6f6225c
2 files changed
Lines changed: 63 additions & 1 deletion
File tree
- backends/arm
- _passes
- test/passes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
54 | 79 | | |
55 | 80 | | |
56 | | - | |
| 81 | + | |
57 | 82 | | |
58 | 83 | | |
59 | 84 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments