Skip to content

Commit 7d4454c

Browse files
allenwang28facebook-github-bot
authored andcommitted
Build with nightly Torch instead of the latest (#1681)
Summary: Changes in the PyTorch C++ layer affect Monarch's tensor engine builds. Without this change, the CI builds will pick up the latest PyTorch through build-requirements.txt. This diff removes this dependency. We see this affecting #1680 Reviewed By: amirafzali Differential Revision: D85670693
1 parent 17de318 commit 7d4454c

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

.github/workflows/build-cpu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
submodules: recursive
2424
upload-artifact: monarch-cpu-${{ github.sha }}
2525
script: |
26+
# Install torch nightly (CPU version)
27+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
28+
2629
# Source common setup functions
2730
source scripts/common-setup.sh
2831

.github/workflows/build-cuda.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
submodules: recursive
2929
upload-artifact: monarch-cuda-${{ github.sha }}
3030
script: |
31+
# Install torch nightly first
32+
pip install ${{ matrix.torch-spec }}
33+
3134
# Source common setup functions
3235
source scripts/common-setup.sh
3336

.github/workflows/test-gpu-python.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
# Setup CUDA environment and library paths
4646
setup_cuda_environment
4747
48+
# Install torch nightly before installing the wheel,
49+
# so that we can test the wheel against the latest nightly
50+
pip install ${{ matrix.torch-spec }}
51+
4852
# Install the built wheel from artifact
4953
install_wheel_from_artifact
5054

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ torchmonarch-nightly is built with torch nightly.
7070

7171
### Build and Install from Source
7272

73+
If you're building Monarch from source, you should be building it with the nightly PyTorch as well for ABI compatibility.
74+
75+
7376
#### On Fedora distributions
7477

7578
```sh
@@ -87,7 +90,7 @@ rustup default nightly
8790
conda install libunwind -y
8891

8992
# Install the correct cuda and cuda-toolkit versions for your machine
90-
sudo dnf install cuda-toolkit-12-0 cuda-12-0
93+
sudo dnf install cuda-toolkit-12-8 cuda-12-8
9194

9295
# Install clang-dev and nccl-dev
9396
sudo dnf install clang-devel libnccl-devel
@@ -99,6 +102,7 @@ conda update -n monarchenv --all -c conda-forge -y
99102
sudo dnf install -y libibverbs rdma-core libmlx5 libibverbs-devel rdma-core-devel
100103

101104
# Install build dependencies
105+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
102106
pip install -r build-requirements.txt
103107
# Install test dependencies
104108
pip install -r python/tests/requirements.txt
@@ -134,7 +138,11 @@ sudo apt install -y clang
134138
export CC=clang
135139
export CXX=clang++
136140

141+
# Install the correct cuda and cuda-toolkit versions for your machine
142+
sudo apt install -y cuda-toolkit-12-8 cuda-12-8
143+
137144
# Install build dependencies
145+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
138146
pip install -r build-requirements.txt
139147
# Install test dependencies
140148
pip install -r python/tests/requirements.txt
@@ -153,9 +161,9 @@ pip install --no-build-isolation -e .
153161
pip list | grep monarch
154162
```
155163

156-
#### On MacOS
164+
#### On non-CUDA machines
157165

158-
You can also build Monarch to run locally on a MacOS system.
166+
You can also build Monarch to run on non-CUDA machines, e.g. locally on a MacOS system.
159167

160168
Note that this does not support tensor engine, which is tied to CUDA and RDMA (via ibverbs).
161169

@@ -172,6 +180,7 @@ rustup toolchain install nightly
172180
rustup default nightly
173181

174182
# Install build dependencies
183+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
175184
pip install -r build-requirements.txt
176185
# Install test dependencies
177186
pip install -r python/tests/requirements.txt

0 commit comments

Comments
 (0)