Commit 53240c6
authored
[Bugfix] Untie word embeddings (#1646)
## Purpose ##
* Fix models which have tied word embeddings by untying the word
embeddings
* This was previously thought to have been fixed by
`patch_tied_tensors_bug`, but that solution came from a misunderstanding
that the mode config was prescriptive, rather than descriptive (that
modifying the config would untie the model weights)
## Changes ##
* Replace `patch_tied_tensors_bug` with `untie_word_embeddings`
* Do no load models with a ranged `tie_word_embeddings` config
## Testing ##
* Verified that saved model now has untied weights
* Previous tied tensors tests which were failing now pass
---------
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>1 parent 2b00d04 commit 53240c6
File tree
3 files changed
+43
-57
lines changed- src/llmcompressor
- entrypoints
- transformers/sparsification
- tests/llmcompressor/transformers/sparsification
3 files changed
+43
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | | - | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
| |||
Lines changed: 25 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
| |||
Lines changed: 15 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
| |||
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
240 | | - | |
241 | | - | |
| 238 | + | |
| 239 | + | |
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
246 | 244 | | |
247 | 245 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 246 | + | |
253 | 247 | | |
254 | 248 | | |
255 | 249 | | |
256 | 250 | | |
257 | 251 | | |
258 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
259 | 255 | | |
260 | 256 | | |
261 | 257 | | |
| |||
294 | 290 | | |
295 | 291 | | |
296 | 292 | | |
297 | | - | |
298 | | - | |
299 | | - | |
| 293 | + | |
300 | 294 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
| 295 | + | |
| 296 | + | |
308 | 297 | | |
309 | 298 | | |
310 | 299 | | |
311 | 300 | | |
312 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
313 | 305 | | |
314 | 306 | | |
315 | 307 | | |
| |||
332 | 324 | | |
333 | 325 | | |
334 | 326 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 327 | + | |
| 328 | + | |
341 | 329 | | |
342 | 330 | | |
343 | 331 | | |
| |||
0 commit comments