Commit c67c5c5
committed
Migrate to uv and pyproject.toml (#2148)
Summary:
Pull Request resolved: #2148
Migrates Monarch to use `uv` and rely more on `pyproject.toml`.
- Migrate static package metadata from setup.py to pyproject.toml
- Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu)
- Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet.
- Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128`
- Make torch optional with auto-detection and graceful degradation when not available
- We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script.
- This also allows us to avoid needing to build with `--no-build-isolation`.
- Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions
- Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature.
- Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`.
- add a uv.lock file which ...
- Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more.
TODO:
- will need to remove some of the requirements.txt after we make sure that the CI is working
Differential Revision: D892295051 parent 8c0401b commit c67c5c5
File tree
19 files changed
+1826
-109
lines changed- monarch_extension
- monarch_hyperactor_bin
- src/bin/process_allocator
- test
- monarch_hyperactor
- monarch_messages
- monarch_rdma/extension
- monarch_tensor_worker
- monarch_types
- scripts
- torch-sys-cuda
- torch-sys2
19 files changed
+1826
-109
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| |||
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | | - | |
37 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | | - | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | | - | |
52 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | 64 | | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
| |||
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
| 79 | + | |
67 | 80 | | |
68 | 81 | | |
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
73 | | - | |
74 | | - | |
| 86 | + | |
| 87 | + | |
75 | 88 | | |
76 | 89 | | |
77 | 90 | | |
| |||
161 | 174 | | |
162 | 175 | | |
163 | 176 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 177 | + | |
| 178 | + | |
167 | 179 | | |
| 180 | + | |
| 181 | + | |
168 | 182 | | |
169 | 183 | | |
170 | 184 | | |
| |||
180 | 194 | | |
181 | 195 | | |
182 | 196 | | |
183 | | - | |
184 | | - | |
185 | 197 | | |
186 | 198 | | |
187 | 199 | | |
| |||
192 | 204 | | |
193 | 205 | | |
194 | 206 | | |
195 | | - | |
196 | 207 | | |
197 | 208 | | |
198 | | - | |
| 209 | + | |
| 210 | + | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
| |||
205 | 217 | | |
206 | 218 | | |
207 | 219 | | |
| 220 | + | |
208 | 221 | | |
209 | 222 | | |
210 | 223 | | |
| |||
213 | 226 | | |
214 | 227 | | |
215 | 228 | | |
| 229 | + | |
216 | 230 | | |
217 | 231 | | |
218 | 232 | | |
| 233 | + | |
219 | 234 | | |
220 | | - | |
221 | | - | |
| 235 | + | |
| 236 | + | |
222 | 237 | | |
223 | 238 | | |
224 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 10 | | |
20 | 11 | | |
21 | 12 | | |
| |||
26 | 17 | | |
27 | 18 | | |
28 | 19 | | |
29 | | - | |
30 | 20 | | |
31 | 21 | | |
32 | 22 | | |
| |||
39 | 29 | | |
40 | 30 | | |
41 | 31 | | |
42 | | - | |
43 | 32 | | |
44 | 33 | | |
45 | 34 | | |
46 | 35 | | |
47 | 36 | | |
48 | 37 | | |
49 | | - | |
| 38 | + | |
50 | 39 | | |
51 | 40 | | |
52 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
File renamed without changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments