Skip to content

Commit b422a85

Browse files
committed
Merge branch 'master' into dev
2 parents a344009 + abbece1 commit b422a85

File tree

4 files changed

+407
-248
lines changed

4 files changed

+407
-248
lines changed

.github/workflows/build-wheels-release-rocm62.yml

Lines changed: 22 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,25 @@ jobs:
2020
matrix:
2121
include:
2222

23-
# Ubuntu 20.04 CUDA
23+
# Ubuntu 22.04 CUDA
2424

2525
# ROCm 6.2
26-
- { artname: 'wheel', os: ubuntu-20.04-l, pyver: '3.10', cuda: '', rocm: '6.2', torch: '2.5.0', cudaarch: '' }
27-
- { artname: 'wheel', os: ubuntu-20.04-l, pyver: '3.11', cuda: '', rocm: '6.2', torch: '2.5.0', cudaarch: '' }
28-
- { artname: 'wheel', os: ubuntu-20.04-l, pyver: '3.12', cuda: '', rocm: '6.2', torch: '2.5.0', cudaarch: '' }
26+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.10', cuda: '', rocm: '6.2', torch: '2.5.0', cudaarch: '' }
27+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.11', cuda: '', rocm: '6.2', torch: '2.5.0', cudaarch: '' }
28+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.12', cuda: '', rocm: '6.2', torch: '2.5.0', cudaarch: '' }
2929

3030
# ROCm 6.2.4
31-
- { artname: 'wheel', os: ubuntu-20.04-l, pyver: '3.10', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
32-
- { artname: 'wheel', os: ubuntu-20.04-l, pyver: '3.11', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
33-
- { artname: 'wheel', os: ubuntu-20.04-l, pyver: '3.12', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
34-
- { artname: 'wheel', os: ubuntu-20.04-l, pyver: '3.13', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
31+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.10', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
32+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.11', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
33+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.12', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
34+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.13', cuda: '', rocm: '6.2.4', torch: '2.6.0', cudaarch: '' }
35+
36+
# ROCm 6.3
37+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.10', cuda: '', rocm: '6.3', torch: '2.7.0', cudaarch: '' }
38+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.11', cuda: '', rocm: '6.3', torch: '2.7.0', cudaarch: '' }
39+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.12', cuda: '', rocm: '6.3', torch: '2.7.0', cudaarch: '' }
40+
- { artname: 'wheel', os: ubuntu-22.04-l, pyver: '3.13', cuda: '', rocm: '6.3', torch: '2.7.0', cudaarch: '' }
41+
3542

3643
fail-fast: false
3744

@@ -53,14 +60,8 @@ jobs:
5360
large-packages: false
5461
swap-storage: true
5562

56-
# Setup Python
57-
5863
- uses: actions/checkout@v4
5964

60-
- uses: actions/setup-python@v5.4.0
61-
with:
62-
python-version: ${{ matrix.pyver }}
63-
6465
# Get version string from package
6566

6667
- name: Get version string
@@ -78,11 +79,11 @@ jobs:
7879
Write-Output "PACKAGE_VERSION=None" >> "$env:GITHUB_OUTPUT"
7980
}
8081
81-
# Pin VS build tools to 17.9 so builds won't fail
82-
83-
- name: Install VS2022 BuildTools 17.9.7
84-
run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
85-
if: runner.os == 'Windows'
82+
# Install uv for easier python setup
83+
- name: Install the latest version of uv and set the python version
84+
uses: astral-sh/setup-uv@v5
85+
with:
86+
python-version: ${{ matrix.pyver }}
8687

8788
# Install ROCm SDK, apparently needs to happen before setting up Python
8889

@@ -111,101 +112,15 @@ jobs:
111112
112113
# --- Install dependencies
113114
114-
python3 -m ensurepip --upgrade
115-
pip3 install torch==${{ matrix.torch }} --index-url="https://download.pytorch.org/whl/rocm$ROCM_VERSION"
116-
pip3 install --upgrade setuptools==69.5.1 build wheel safetensors sentencepiece ninja
117-
pip3 cache purge
115+
uv pip install torch==${{ matrix.torch }} --index-url="https://download.pytorch.org/whl/rocm$ROCM_VERSION"
116+
uv pip install --upgrade build setuptools==69.5.1 wheel packaging ninja safetensors sentencepiece tokenizers numpy
118117
119118
# --- Build wheel
120119
121120
python3 -m build -n --wheel -C--build-option=egg_info "-C--build-option=--tag-build=+rocm${{ matrix.rocm }}-torch${{ matrix.torch }}"
122121
123-
# Build for CUDA
124-
125-
- name: Setup Mamba
126-
if: matrix.cuda != ''
127-
uses: conda-incubator/setup-miniconda@v3.1.0
128-
with:
129-
activate-environment: "exllama"
130-
python-version: ${{ matrix.pyver }}
131-
# miniforge-variant: Mambaforge
132-
miniforge-version: latest
133-
# use-mamba: true
134-
add-pip-as-python-dependency: true
135-
auto-activate-base: false
136-
137-
- name: Build for CUDA
138-
if: matrix.cuda != ''
139-
run: |
140-
# --- Spawn the VS shell
141-
if ($IsWindows) {
142-
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
143-
Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
144-
$env:DISTUTILS_USE_SDK=1
145-
}
146-
147-
# --- Install CUDA using Conda
148-
$cudaVersion = '${{ matrix.cuda }}'
149-
$cudaVersionPytorch = '${{ matrix.cuda }}'.Remove('${{ matrix.cuda }}'.LastIndexOf('.')).Replace('.','')
150-
151-
$env:MAMBA_NO_LOW_SPEED_LIMIT = 1
152-
mamba install -y -c nvidia/label/cuda-$cudaVersion cuda-toolkit cuda-runtime
153-
154-
if (!(mamba list cuda)[-1].contains('cuda')) {sleep -s 10; mamba install -y 'cuda' $cudaVersion}
155-
if (!(mamba list cuda)[-1].contains('cuda')) {throw 'CUDA Toolkit failed to install!'}
156-
157-
$env:CUDA_PATH = $env:CONDA_PREFIX
158-
$env:CUDA_HOME = $env:CONDA_PREFIX
159-
if ($IsLinux) {$env:LD_LIBRARY_PATH = $env:CONDA_PREFIX + '/lib:' + $env:LD_LIBRARY_PATH}
160-
161-
# --- Install dependencies
162-
163-
python -m ensurepip --upgrade
164-
python -m pip install torch==${{ matrix.torch }} --index-url https://download.pytorch.org/whl/cu$cudaVersionPytorch
165-
python -m pip install --upgrade setuptools==69.5.1 build wheel safetensors sentencepiece ninja
166-
167-
# --- Build wheel
168-
169-
$BUILDTAG = "+cu$cudaVersionPytorch-torch${{ matrix.torch }}"
170-
$env:TORCH_CUDA_ARCH_LIST = '${{ matrix.cudaarch }}'
171-
python -m build -n --wheel -C--build-option=egg_info "-C--build-option=--tag-build=$BUILDTAG"
172-
173-
# Build sdist
174-
175-
- name: Build sdist
176-
if: matrix.cuda == '' && matrix.rocm == ''
177-
run: |
178-
# --- Spawn the VS shell
179-
if ($IsWindows) {
180-
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
181-
Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
182-
$env:DISTUTILS_USE_SDK=1
183-
}
184-
185-
# --- Install dependencies
186-
187-
python -m pip install torch==${{ matrix.torch }} --index-url https://download.pytorch.org/whl/cpu
188-
python -m pip install build wheel ninja
189-
190-
# --- Build wheel
191-
192-
$env:EXLLAMA_NOCOMPILE=1
193-
python -m build -n
194-
195122
# Upload files
196123

197-
- uses: actions/upload-artifact@v4
198-
if: matrix.artname == 'wheel'
199-
with:
200-
name: wheel-${{ matrix.os }}-py${{ matrix.pyver }}-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}
201-
path: ./dist/*
202-
203-
- uses: actions/upload-artifact@v4
204-
if: matrix.artname == 'sdist'
205-
with:
206-
name: 'sdist'
207-
path: ./dist/*
208-
209124
- name: Upload files to GitHub release
210125
if: steps.package_version.outputs.PACKAGE_VERSION != 'None' && inputs.release == '1'
211126
uses: svenstaro/upload-release-action@2.6.1

0 commit comments

Comments
 (0)