Skip to content

Commit bcccee4

Browse files
authored
Fix cupy install version detection (deepspeedai#3276)
* updated cupy install * do non-isolated pip install * Update action.yml
1 parent 077e42e commit bcccee4

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/nv-torch19-p40.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Install deepspeed
4747
run: |
48-
pip install .[dev,1bit,autotuning]
48+
pip install .[dev,1bit,autotuning] --no-build-isolation
4949
ds_report
5050
5151
- name: Python environment

.github/workflows/nv-torch19-v100.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Install deepspeed
4747
run: |
48-
pip install .[dev,1bit,autotuning]
48+
pip install .[dev,1bit,autotuning] --no-build-isolation
4949
ds_report
5050
5151
- name: Python environment

.github/workflows/setup-venv/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ runs:
1515
python -m venv unit-test-venv
1616
source ./unit-test-venv/bin/activate
1717
python -m pip install --upgrade pip
18+
pip install wheel # required after pip>=23.1
1819
echo PATH=$PATH >> $GITHUB_ENV # Make it so venv is inherited for other steps
1920
shell: bash
2021
- id: print-env

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ def fetch_requirements(path):
7878
if rocm_major <= 4:
7979
cupy = f"cupy-rocm-{rocm_major}-{rocm_minor}"
8080
else:
81-
cupy = f"cupy-cuda{''.join(map(str,installed_cuda_version()))}"
81+
cuda_major_ver, cuda_minor_ver = installed_cuda_version()
82+
if (cuda_major_ver < 11) or ((cuda_major_ver == 11) and (cuda_minor_ver < 3)):
83+
cupy = f"cupy-cuda{cuda_major_ver}{cuda_minor_ver}"
84+
else:
85+
cupy = f"cupy-cuda{cuda_major_ver}x"
86+
8287
if cupy:
8388
extras_require['1bit'].append(cupy)
8489
extras_require['1bit_mpi'].append(cupy)

0 commit comments

Comments
 (0)