You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: D89229505
Copy file name to clipboardExpand all lines: README.md
+37-22Lines changed: 37 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,18 @@
3
3
**Monarch** is a distributed programming framework for PyTorch based on scalable
4
4
actor messaging. It provides:
5
5
6
-
1. Remote actors with scalable messaging: Actors are grouped into collections called meshes and messages can be broadcast to all members.
7
-
2. Fault tolerance through supervision trees: Actors and processes form a tree and failures propagate up the tree, providing good default error behavior and enabling fine-grained fault recovery.
8
-
3. Point-to-point RDMA transfers: cheap registration of any GPU or CPU memory in a process, with the one-sided transfers based on libibverbs
9
-
4. Distributed tensors: actors can work with tensor objects sharded across processes
10
-
11
-
Monarch code imperatively describes how to create processes and actors using a simple python API:
6
+
1. Remote actors with scalable messaging: Actors are grouped into collections
7
+
called meshes and messages can be broadcast to all members.
8
+
2. Fault tolerance through supervision trees: Actors and processes form a tree
9
+
and failures propagate up the tree, providing good default error behavior and
10
+
enabling fine-grained fault recovery.
11
+
3. Point-to-point RDMA transfers: cheap registration of any GPU or CPU memory in
12
+
a process, with the one-sided transfers based on libibverbs
13
+
4. Distributed tensors: actors can work with tensor objects sharded across
14
+
processes
15
+
16
+
Monarch code imperatively describes how to create processes and actors using a
17
+
simple python API:
12
18
13
19
```python
14
20
from monarch.actor import Actor, endpoint, this_host
@@ -33,8 +39,9 @@ fut = trainers.train.call(step=0)
33
39
fut.get()
34
40
```
35
41
36
-
37
-
The [introduction to monarch concepts](https://meta-pytorch.org/monarch/generated/examples/getting_started.html) provides an introduction to using these features.
42
+
The
43
+
[introduction to monarch concepts](https://meta-pytorch.org/monarch/generated/examples/getting_started.html)
44
+
provides an introduction to using these features.
38
45
39
46
> ⚠️ **Early Development Warning** Monarch is currently in an experimental
40
47
> stage. You should expect bugs, incomplete features, and APIs that may change
@@ -45,16 +52,21 @@ The [introduction to monarch concepts](https://meta-pytorch.org/monarch/generate
45
52
46
53
## 📖 Documentation
47
54
48
-
View Monarch's hosted documentation [at this link](https://meta-pytorch.org/monarch/).
55
+
View Monarch's hosted documentation
56
+
[at this link](https://meta-pytorch.org/monarch/).
49
57
50
58
## Installation
51
-
Note for running distributed tensors and RDMA, the local torch version must match the version that monarch was built with.
52
-
Stable and nightly distributions require libmxl and libibverbs (runtime).
59
+
60
+
Note for running distributed tensors and RDMA, the local torch version must
61
+
match the version that monarch was built with. Stable and nightly distributions
Copy file name to clipboardExpand all lines: monarch_hyperactor/Cargo.toml
+2-13Lines changed: 2 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# @generated by autocargo from //monarch/monarch_hyperactor:[monarch_hyperactor,monarch_hyperactor_test_bootstrap,process_allocator-oss,test_monarch_hyperactor]
1
+
# @generated by autocargo from //monarch/monarch_hyperactor:[monarch_hyperactor,test_monarch_hyperactor]
2
2
3
3
[package]
4
4
name = "monarch_hyperactor"
@@ -7,15 +7,6 @@ authors = ["Meta"]
7
7
edition = "2021"
8
8
license = "BSD-3-Clause"
9
9
10
-
[[bin]]
11
-
name = "monarch_hyperactor_test_bootstrap"
12
-
path = "test/bootstrap.rs"
13
-
edition = "2024"
14
-
15
-
[[bin]]
16
-
name = "process_allocator"
17
-
edition = "2024"
18
-
19
10
[[test]]
20
11
name = "test_monarch_hyperactor"
21
12
path = "tests/lib.rs"
@@ -26,7 +17,6 @@ async-once-cell = "0.4.2"
26
17
async-trait = "0.1.86"
27
18
bincode = "1.3.3"
28
19
bytes = { version = "1.10", features = ["serde"] }
29
-
clap = { version = "4.5.42", features = ["derive", "env", "string", "unicode", "wrap_help"] }
0 commit comments