Skip to content

Commit 3aabad2

Browse files
committed
Temp action to update 0.1.8 with Torch 2.4.0 and ROCm 6.1 wheels
1 parent 7e5f0db commit 3aabad2

File tree

1 file changed

+283
-0
lines changed

1 file changed

+283
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
name: Build Wheels & Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release:
7+
description: 'Release? 1 = yes, 0 = no'
8+
default: '0'
9+
required: true
10+
type: string
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build_wheels:
17+
name: ${{ matrix.os }} Python=${{ matrix.pyver }} CUDA=${{ matrix.cuda }} ROCm=${{ matrix.rocm }} Torch=${{ matrix.torch }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
include:
22+
23+
# Ubuntu 20.04 CUDA
24+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.8', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
25+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.8', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
26+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.8', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
27+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.8', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
28+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.8', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
29+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.9', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
30+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.9', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
31+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.9', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
32+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.9', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
33+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.9', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
34+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
35+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
36+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
37+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
38+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
39+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
40+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
41+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
42+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
43+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
44+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.12', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
45+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.12', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
46+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.12', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
47+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.12', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
48+
49+
# Windows 2022 CUDA
50+
# - { artname: 'wheel', os: windows-2022, pyver: '3.8', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
51+
# - { artname: 'wheel', os: windows-2022, pyver: '3.8', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
52+
# - { artname: 'wheel', os: windows-2022, pyver: '3.8', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
53+
- { artname: 'wheel', os: windows-2022, pyver: '3.8', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
54+
- { artname: 'wheel', os: windows-2022, pyver: '3.8', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
55+
# - { artname: 'wheel', os: windows-2022, pyver: '3.9', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
56+
# - { artname: 'wheel', os: windows-2022, pyver: '3.9', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
57+
# - { artname: 'wheel', os: windows-2022, pyver: '3.9', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
58+
- { artname: 'wheel', os: windows-2022, pyver: '3.9', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
59+
- { artname: 'wheel', os: windows-2022, pyver: '3.9', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
60+
# - { artname: 'wheel', os: windows-2022, pyver: '3.10', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
61+
# - { artname: 'wheel', os: windows-2022, pyver: '3.10', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
62+
# - { artname: 'wheel', os: windows-2022, pyver: '3.10', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
63+
- { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
64+
- { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
65+
# - { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '11.7.0', rocm: '', torch: '2.0.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6+PTX' }
66+
# - { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
67+
# - { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
68+
- { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
69+
- { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
70+
# - { artname: 'wheel', os: windows-2022, pyver: '3.12', cuda: '11.8.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
71+
# - { artname: 'wheel', os: windows-2022, pyver: '3.12', cuda: '12.1.0', rocm: '', torch: '2.3.1', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
72+
- { artname: 'wheel', os: windows-2022, pyver: '3.12', cuda: '11.8.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
73+
- { artname: 'wheel', os: windows-2022, pyver: '3.12', cuda: '12.1.0', rocm: '', torch: '2.4.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
74+
75+
76+
# Ubuntu 20.04 ROCm
77+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '', rocm: '5.6', torch: '2.2.2', cudaarch: '' }
78+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '', rocm: '5.6', torch: '2.2.2', cudaarch: '' }
79+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '', rocm: '6.0', torch: '2.3.1', cudaarch: '' }
80+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '', rocm: '6.0', torch: '2.3.1', cudaarch: '' }
81+
# - { artname: 'wheel', os: ubuntu-20.04, pyver: '3.12', cuda: '', rocm: '6.0', torch: '2.3.1', cudaarch: '' }
82+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '', rocm: '6.1', torch: '2.4.0', cudaarch: '' }
83+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.11', cuda: '', rocm: '6.1', torch: '2.4.0', cudaarch: '' }
84+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.12', cuda: '', rocm: '6.1', torch: '2.4.0', cudaarch: '' }
85+
86+
# sdist
87+
- { artname: 'sdist', os: ubuntu-20.04, pyver: '3.11', cuda: '', rocm: '', torch: '2.3.1', cudaarch: '' }
88+
89+
# Extra Torch 2.2 wheels for Windows 2022 until PyTorch resolves the shm.dll issue
90+
- { artname: 'wheel', os: windows-2022, pyver: '3.8', cuda: '11.8.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
91+
- { artname: 'wheel', os: windows-2022, pyver: '3.8', cuda: '12.1.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
92+
- { artname: 'wheel', os: windows-2022, pyver: '3.9', cuda: '11.8.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
93+
- { artname: 'wheel', os: windows-2022, pyver: '3.9', cuda: '12.1.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
94+
- { artname: 'wheel', os: windows-2022, pyver: '3.10', cuda: '11.8.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
95+
- { artname: 'wheel', os: windows-2022, pyver: '3.10', cuda: '12.1.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
96+
- { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '11.8.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
97+
- { artname: 'wheel', os: windows-2022, pyver: '3.11', cuda: '12.1.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
98+
- { artname: 'wheel', os: windows-2022, pyver: '3.12', cuda: '11.8.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
99+
- { artname: 'wheel', os: windows-2022, pyver: '3.12', cuda: '12.1.0', rocm: '', torch: '2.2.0', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
100+
101+
# Extra wheel for HF spaces
102+
- { artname: 'wheel', os: ubuntu-20.04, pyver: '3.10', cuda: '12.1.0', rocm: '', torch: '2.2.2', cudaarch: '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
103+
104+
defaults:
105+
run:
106+
shell: pwsh
107+
108+
steps:
109+
# Free disk space
110+
111+
- name: Free Disk Space
112+
uses: jlumbroso/free-disk-space@v1.3.1
113+
if: runner.os == 'Linux'
114+
with:
115+
tool-cache: true
116+
android: true
117+
dotnet: true
118+
haskell: true
119+
large-packages: false
120+
swap-storage: true
121+
122+
# Setup Python
123+
124+
- uses: actions/checkout@v3
125+
126+
- uses: actions/setup-python@v3
127+
with:
128+
python-version: ${{ matrix.pyver }}
129+
130+
# Get version string from package
131+
132+
- name: Get version string
133+
id: package_version
134+
run: |
135+
$versionString = Get-Content $(Join-Path 'exllamav2' 'version.py') -raw
136+
if ($versionString -match '__version__ = "(\d+\.(?:\d+\.?(?:dev\d+)?)*)"')
137+
{
138+
Write-Output $('::notice file=build-wheels-release.yml,line=200,title=Package Version::Detected package version is: {0}' -f $Matches[1])
139+
Write-Output "PACKAGE_VERSION=$($Matches[1])" >> "$env:GITHUB_OUTPUT"
140+
}
141+
else
142+
{
143+
Write-Output '::error file=build-wheels-release.yml,line=203::Could not parse version from exllamav2/version.py! You must upload wheels manually!'
144+
Write-Output "PACKAGE_VERSION=None" >> "$env:GITHUB_OUTPUT"
145+
}
146+
147+
# Pin VS build tools to 17.9 so builds won't fail
148+
149+
- name: Install VS2022 BuildTools 17.9.7
150+
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"
151+
if: runner.os == 'Windows'
152+
153+
# Install ROCm SDK, apparently needs to happen before setting up Python
154+
155+
- name: Build for ROCm
156+
if: matrix.rocm != ''
157+
shell: bash
158+
run: |
159+
# --- Install ROCm SDK
160+
161+
export ROCM_VERSION=${{ matrix.rocm }}
162+
export TORCH_VERSION=${{ matrix.torch }}
163+
164+
[ ! -d /etc/apt/keyrings ] && sudo mkdir --parents --mode=0755 /etc/apt/keyrings
165+
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
166+
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/$ROCM_VERSION focal main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
167+
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
168+
169+
sudo apt update
170+
sudo apt install rocm-hip-sdk -y
171+
sudo apt clean -y
172+
173+
echo "/opt/rocm/bin" >> $GITHUB_PATH
174+
echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV
175+
echo "ROCM_VERSION=$ROCM_VERSION" >> $GITHUB_ENV
176+
echo "USE_ROCM=1" >> $GITHUB_ENV
177+
178+
# --- Install dependencies
179+
180+
python3 -m ensurepip --upgrade
181+
pip3 install torch==${{ matrix.torch }} --index-url="https://download.pytorch.org/whl/rocm$ROCM_VERSION"
182+
pip3 install --upgrade setuptools==69.5.1 build wheel safetensors sentencepiece ninja
183+
pip3 cache purge
184+
185+
# --- Build wheel
186+
187+
python3 -m build -n --wheel -C--build-option=egg_info "-C--build-option=--tag-build=+rocm${{ matrix.rocm }}-torch${{ matrix.torch }}"
188+
189+
# Build for CUDA
190+
191+
- name: Setup Mamba
192+
if: matrix.cuda != ''
193+
uses: conda-incubator/setup-miniconda@v2.3.0
194+
with:
195+
activate-environment: "exllama"
196+
python-version: ${{ matrix.pyver }}
197+
miniforge-variant: Mambaforge
198+
miniforge-version: latest
199+
use-mamba: true
200+
add-pip-as-python-dependency: true
201+
auto-activate-base: false
202+
203+
- name: Build for CUDA
204+
if: matrix.cuda != ''
205+
run: |
206+
# --- Spawn the VS shell
207+
if ($IsWindows) {
208+
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
209+
Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
210+
$env:DISTUTILS_USE_SDK=1
211+
}
212+
213+
# --- Install CUDA using Conda
214+
$cudaVersion = '${{ matrix.cuda }}'
215+
$cudaVersionPytorch = '${{ matrix.cuda }}'.Remove('${{ matrix.cuda }}'.LastIndexOf('.')).Replace('.','')
216+
217+
$env:MAMBA_NO_LOW_SPEED_LIMIT = 1
218+
mamba install -y -c nvidia/label/cuda-$cudaVersion cuda-toolkit cuda-runtime
219+
220+
if (!(mamba list cuda)[-1].contains('cuda')) {sleep -s 10; mamba install -y 'cuda' $cudaVersion}
221+
if (!(mamba list cuda)[-1].contains('cuda')) {throw 'CUDA Toolkit failed to install!'}
222+
223+
$env:CUDA_PATH = $env:CONDA_PREFIX
224+
$env:CUDA_HOME = $env:CONDA_PREFIX
225+
if ($IsLinux) {$env:LD_LIBRARY_PATH = $env:CONDA_PREFIX + '/lib:' + $env:LD_LIBRARY_PATH}
226+
227+
# --- Install dependencies
228+
229+
python -m ensurepip --upgrade
230+
python -m pip install torch==${{ matrix.torch }} --index-url https://download.pytorch.org/whl/cu$cudaVersionPytorch
231+
python -m pip install --upgrade setuptools==69.5.1 build wheel safetensors sentencepiece ninja
232+
233+
# --- Build wheel
234+
235+
$BUILDTAG = "+cu$cudaVersionPytorch-torch${{ matrix.torch }}"
236+
$env:TORCH_CUDA_ARCH_LIST = '${{ matrix.cudaarch }}'
237+
python -m build -n --wheel -C--build-option=egg_info "-C--build-option=--tag-build=$BUILDTAG"
238+
239+
# Build sdist
240+
241+
- name: Build sdist
242+
if: matrix.cuda == '' && matrix.rocm == ''
243+
run: |
244+
# --- Spawn the VS shell
245+
if ($IsWindows) {
246+
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
247+
Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
248+
$env:DISTUTILS_USE_SDK=1
249+
}
250+
251+
# --- Install dependencies
252+
253+
python -m pip install torch==${{ matrix.torch }} --index-url https://download.pytorch.org/whl/cpu
254+
python -m pip install build wheel ninja
255+
256+
# --- Build wheel
257+
258+
$env:EXLLAMA_NOCOMPILE=1
259+
python -m build -n
260+
261+
# Upload files
262+
263+
- uses: actions/upload-artifact@v3
264+
if: matrix.artname == 'wheel'
265+
with:
266+
name: 'wheel'
267+
path: ./dist/*
268+
269+
- uses: actions/upload-artifact@v3
270+
if: matrix.artname == 'sdist'
271+
with:
272+
name: 'sdist'
273+
path: ./dist/*
274+
275+
- name: Upload files to GitHub release
276+
if: steps.package_version.outputs.PACKAGE_VERSION != 'None' && inputs.release == '1'
277+
uses: svenstaro/upload-release-action@2.6.1
278+
with:
279+
file: ./dist/*.whl
280+
tag: ${{ format('v{0}', steps.package_version.outputs.PACKAGE_VERSION) }}
281+
file_glob: true
282+
overwrite: true
283+
release_name: ${{ steps.package_version.outputs.PACKAGE_VERSION }}

0 commit comments

Comments
 (0)