Commit 28a8f56
authored
Fix constant in constant folding (#2622)
This PR moves the processing of constant ops upward to return before
node-level shape type inference (including serialization) and optimizer
optimization.
Essentially, avoiding serializing constant ops (potentially large
weights in LLMs) reduces the export time in optimize_ir.
Before this PR:
<img width="2119" height="282" alt="Screenshot 2025-10-09 141403"
src="https://github.com/user-attachments/assets/4d50d3ee-ce84-4f8b-bc20-f56497d7dad1"
/>
After this PR:
<img width="2390" height="319" alt="Screenshot 2025-10-09 141238"
src="https://github.com/user-attachments/assets/f455942e-dde8-4a07-a94e-a5f817358579"
/>1 parent 59c3d32 commit 28a8f56
1 file changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1102 | 1106 | | |
1103 | | - | |
| 1107 | + | |
1104 | 1108 | | |
1105 | 1109 | | |
1106 | 1110 | | |
| |||
1118 | 1122 | | |
1119 | 1123 | | |
1120 | 1124 | | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1121 | 1129 | | |
1122 | 1130 | | |
1123 | 1131 | | |
| |||
1137 | 1145 | | |
1138 | 1146 | | |
1139 | 1147 | | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | 1148 | | |
1145 | 1149 | | |
1146 | 1150 | | |
| |||
0 commit comments