Commit 861d2cc
Add a param for save format in Storage Writer (pytorch#150025)
Summary: add a param to specify to the storage writer how to save tensors. Write now the only options are safetensors and torch.save.
Test Plan:
(lintrunner) [[email protected] /data/users/ankitageorge/fbsource/fbcode/caffe2 (1d57cb27b)]$ buck2 test 'fbcode//mode/opt' fbcode//caffe2/test/distributed/checkpoint:test_hf_storage
File changed: fbcode//caffe2/torch/distributed/checkpoint/filesystem.py
Buck UI: https://www.internalfb.com/buck2/e80cc963-e34a-4876-b6f4-7ce2794e48dd
Test UI: https://www.internalfb.com/intern/testinfra/testrun/3659174965882569
Network: Up: 32KiB Down: 1.9KiB (reSessionID-ef9fa764-a40a-451b-ab58-08eabe7a9422)
Executing actions. Remaining 0/4 3.4s exec time total
Command: test. Finished 2 local
Time elapsed: 19.6s
Tests finished: Pass 4. Fail 0. Fatal 0. Skip 0. Build failure 0
Reviewed By: saumishr
Differential Revision: D70271943
Pull Request resolved: pytorch#150025
Approved by: https://github.com/saumishr1 parent c53bc61 commit 861d2cc
File tree
3 files changed
+38
-13
lines changed- torch/distributed/checkpoint
3 files changed
+38
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| 144 | + | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | | - | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
| |||
298 | 310 | | |
299 | 311 | | |
300 | 312 | | |
301 | | - | |
| 313 | + | |
302 | 314 | | |
303 | 315 | | |
304 | 316 | | |
| |||
312 | 324 | | |
313 | 325 | | |
314 | 326 | | |
315 | | - | |
| 327 | + | |
316 | 328 | | |
317 | 329 | | |
318 | 330 | | |
319 | 331 | | |
320 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
321 | 335 | | |
322 | 336 | | |
323 | 337 | | |
| |||
349 | 363 | | |
350 | 364 | | |
351 | 365 | | |
352 | | - | |
| 366 | + | |
353 | 367 | | |
354 | 368 | | |
355 | 369 | | |
| |||
397 | 411 | | |
398 | 412 | | |
399 | 413 | | |
400 | | - | |
| 414 | + | |
401 | 415 | | |
402 | 416 | | |
403 | 417 | | |
| |||
411 | 425 | | |
412 | 426 | | |
413 | 427 | | |
414 | | - | |
| 428 | + | |
415 | 429 | | |
416 | 430 | | |
417 | 431 | | |
418 | 432 | | |
419 | | - | |
| 433 | + | |
420 | 434 | | |
421 | 435 | | |
422 | 436 | | |
| |||
549 | 563 | | |
550 | 564 | | |
551 | 565 | | |
| 566 | + | |
552 | 567 | | |
553 | 568 | | |
554 | 569 | | |
| |||
576 | 591 | | |
577 | 592 | | |
578 | 593 | | |
| 594 | + | |
579 | 595 | | |
580 | 596 | | |
581 | 597 | | |
| |||
638 | 654 | | |
639 | 655 | | |
640 | 656 | | |
641 | | - | |
642 | 657 | | |
643 | 658 | | |
644 | 659 | | |
| |||
655 | 670 | | |
656 | 671 | | |
657 | 672 | | |
658 | | - | |
| 673 | + | |
659 | 674 | | |
660 | 675 | | |
661 | 676 | | |
| |||
670 | 685 | | |
671 | 686 | | |
672 | 687 | | |
673 | | - | |
| 688 | + | |
674 | 689 | | |
675 | 690 | | |
676 | 691 | | |
| |||
892 | 907 | | |
893 | 908 | | |
894 | 909 | | |
| 910 | + | |
895 | 911 | | |
896 | 912 | | |
897 | 913 | | |
| |||
919 | 935 | | |
920 | 936 | | |
921 | 937 | | |
| 938 | + | |
922 | 939 | | |
923 | 940 | | |
924 | 941 | | |
| |||
0 commit comments