Commit 7ceacde
committed
Update on "Save foundation weights separately"
This diff:
1. Introduces SerializationConfig to llm_config. Currently, this allows user to save the foundation weights in a separate file; majorly useful for lora case.
2. Adds a pass to tag foundation (non-lora) weights. This is at the top-level (export_llama_lib). The tags are preserved through run_decomps/other passes, and do not affect functionality.
3. Tags are read when placing constants into the named_data_store.
4. Tagged weights are serialized to a separate file.
Notes
1. Adding tags to node.meta['custom']['blah'] means that they will not be discarded by run_decompositions
2. Adding tags to the lifted model (ep.graph_module) requires the EP to check is_param_node for xnnpack constants. Instead, add tags to the unlifted model (ep.module()), so we do not need to go through a re-export to get the EP.
3. Not an issue for this diff as llama doesn't have any higher order ops. Adding tags to models with higher-order ops is problematic due to nested submodules.
Differential Revision: [D79181064](https://our.internmc.facebook.com/intern/diff/D79181064/)
[ghstack-poisoned]File tree
3 files changed
+8
-23
lines changed- .ci/scripts
- examples/models/llama
- extension/llm/export/config
3 files changed
+8
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1078 | 1078 | | |
1079 | 1079 | | |
1080 | 1080 | | |
1081 | | - | |
| 1081 | + | |
1082 | 1082 | | |
1083 | | - | |
| 1083 | + | |
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| |||
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
| 225 | + | |
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| |||
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | 234 | | |
245 | 235 | | |
246 | 236 | | |
| |||
480 | 470 | | |
481 | 471 | | |
482 | 472 | | |
483 | | - | |
484 | 473 | | |
485 | 474 | | |
486 | 475 | | |
| |||
560 | 549 | | |
561 | 550 | | |
562 | 551 | | |
563 | | - | |
564 | | - | |
565 | 552 | | |
566 | | - | |
567 | | - | |
568 | | - | |
| 553 | + | |
569 | 554 | | |
570 | 555 | | |
571 | 556 | | |
| |||
0 commit comments