Commit 3bf4be5
committed
torch-sys --> torch-sys2, monarch no longer links torch
Pull Request resolved: #2046
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.
There are significant advantages now:
* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 326996723
@exported-using-ghexport
Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)1 parent 7c86587 commit 3bf4be5
File tree
52 files changed
+1152
-6857
lines changed- .github/workflows
- docs/source
- monarch_extension
- src
- monarch_messages
- src
- monarch_tensor_worker
- src
- python
- monarch
- _rust_bindings/monarch_extension
- _src/actor
- tests/_monarch
- torch-sys-cuda
- src
- torch-sys2
- src
- torch-sys
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
52 files changed
+1152
-6857
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 13 | | |
19 | 14 | | |
20 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 76 | | |
98 | 77 | | |
99 | 78 | | |
100 | 79 | | |
101 | 80 | | |
102 | 81 | | |
103 | 82 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 83 | | |
129 | 84 | | |
130 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
14 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
483 | 482 | | |
484 | 483 | | |
485 | 484 | | |
486 | | - | |
| 485 | + | |
487 | 486 | | |
488 | | - | |
| 487 | + | |
489 | 488 | | |
490 | 489 | | |
491 | 490 | | |
| |||
619 | 618 | | |
620 | 619 | | |
621 | 620 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | 621 | | |
628 | 622 | | |
629 | 623 | | |
| |||
660 | 654 | | |
661 | 655 | | |
662 | 656 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | 657 | | |
670 | 658 | | |
671 | 659 | | |
| |||
0 commit comments