Repository navigation
[CI] Fix deepspeed astral's cu128 index incompatible with Torch 2.9 - #65936
Conversation
Signed-off-by: Mark Towers <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request adds the --no-binary deepspeed flag to the uv pip install commands in both docgpu.build.Dockerfile and ml.build.Dockerfile to avoid incompatible prebuilt wheels. However, because uv defaults to build isolation when installing from source, DeepSpeed's setup script will fail to find PyTorch. To prevent this build failure, you should append the --no-build-isolation flag to both commands so that the pre-installed PyTorch from the base image is utilized.
| uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match | ||
| # --no-binary deepspeed: the GPU locks resolve against Astral's cu128 index, which publishes prebuilt deepspeed wheels | ||
| # as local versions (0.18.9+cu.12.8.torch.2.11), however, currently we use torch 2.9 which is incompatible | ||
| uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match --no-binary deepspeed |
There was a problem hiding this comment.
When installing deepspeed from source using --no-binary, uv defaults to build isolation. Since DeepSpeed's setup.py imports torch during the build, this will fail with ModuleNotFoundError because torch is not present in the isolated build environment. Adding --no-build-isolation forces uv to use the pre-installed PyTorch from the base image.
uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match --no-binary deepspeed --no-build-isolation
| uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match | ||
| # --no-binary deepspeed: the GPU locks resolve against Astral's cu128 index, which publishes prebuilt deepspeed wheels | ||
| # as local versions (0.18.9+cu.12.8.torch.2.11), however, currently we use torch 2.9 which is incompatible | ||
| uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match --no-binary deepspeed |
There was a problem hiding this comment.
When installing deepspeed from source using --no-binary, uv defaults to build isolation. Since DeepSpeed's setup.py imports torch during the build, this will fail with ModuleNotFoundError because torch is not present in the isolated build environment. Adding --no-build-isolation forces uv to use the pre-installed PyTorch from the base image.
uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match --no-binary deepspeed --no-build-isolation
…ay-project#65936) ## Description ray-project#65899 added astral's cu128 index for torch-scatter support, however, at the same time, started pulling in a DeepSpeed wheel that was compiled with torch 2.11 This wheel is incompatible with our torch 2.9 install causing ``` RuntimeError: PyTorch version mismatch! DeepSpeed ops were compiled and installed with a different version than what is being used at runtime. Please re-install DeepSpeed or switch torch versions. Install torch version=2.11, Runtime torch version=2.9 ``` This PR fixes it through adding `--no-binary` to `uv` for `deepspeed` to ensure that deepspeed is built locally using the current torch version. In this future this could be removed. Signed-off-by: Mark Towers <[email protected]> Co-authored-by: Mark Towers <[email protected]>
Description
#65899 added astral's cu128 index for torch-scatter support, however, at the same time, started pulling in a DeepSpeed wheel that was compiled with torch 2.11
This wheel is incompatible with our torch 2.9 install causing
This PR fixes it through adding
--no-binarytouvfordeepspeedto ensure that deepspeed is built locally using the current torch version. In this future this could be removed.