Skip to content

Commit ad78ebd

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 5afdea6 commit ad78ebd

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

.github/workflows/build-cpu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ jobs:
2929
# Setup build environment (conda + system deps + rust + build deps)
3030
setup_build_environment
3131
32+
# Install torch nightly (CPU version)
33+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
34+
3235
# Build monarch (No tensor engine, CPU version)
3336
USE_TENSOR_ENGINE=0 python setup.py bdist_wheel

.github/workflows/build-cuda.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
3434
# Setup build environment (conda + system deps + rust + build deps)
3535
setup_build_environment
36+
pip install ${{ matrix.torch-spec }}
3637
3738
# Setup Tensor Engine
3839
setup_tensor_engine

.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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ rustup default nightly
8787
conda install libunwind -y
8888

8989
# Install the correct cuda and cuda-toolkit versions for your machine
90-
sudo dnf install cuda-toolkit-12-0 cuda-12-0
90+
sudo dnf install cuda-toolkit-12-6 cuda-12-6
9191

9292
# Install clang-dev and nccl-dev
9393
sudo dnf install clang-devel libnccl-devel
@@ -99,6 +99,7 @@ conda update -n monarchenv --all -c conda-forge -y
9999
sudo dnf install -y libibverbs rdma-core libmlx5 libibverbs-devel rdma-core-devel
100100

101101
# Install build dependencies
102+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
102103
pip install -r build-requirements.txt
103104
# Install test dependencies
104105
pip install -r python/tests/requirements.txt
@@ -134,7 +135,11 @@ sudo apt install -y clang
134135
export CC=clang
135136
export CXX=clang++
136137

138+
# Install the correct cuda and cuda-toolkit versions for your machine
139+
sudo apt install -y cuda-toolkit-12-6 cuda-12-6
140+
137141
# Install build dependencies
142+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
138143
pip install -r build-requirements.txt
139144
# Install test dependencies
140145
pip install -r python/tests/requirements.txt
@@ -153,9 +158,9 @@ pip install --no-build-isolation -e .
153158
pip list | grep monarch
154159
```
155160

156-
#### On MacOS
161+
#### On non-CUDA machines
157162

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

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

@@ -172,6 +177,7 @@ rustup toolchain install nightly
172177
rustup default nightly
173178

174179
# Install build dependencies
180+
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
175181
pip install -r build-requirements.txt
176182
# Install test dependencies
177183
pip install -r python/tests/requirements.txt

build-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
torch
1+
# torch is also a dependency here, but we want to ensure that
2+
# we're building against the PyTorch index for nightly.
23
setuptools
34
setuptools-rust
45
wheel

0 commit comments

Comments
 (0)