From 0b152ffd30a0cb9a9775c5480214396b61ae9e84 Mon Sep 17 00:00:00 2001 From: Mat Sz Date: Wed, 27 Nov 2024 18:08:51 +0100 Subject: [PATCH] feat: add support for zluda --- .github/workflows/build.yml | 13 +++++++++++++ requirements.zluda.txt | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 requirements.zluda.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e326570..57920e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,11 +111,15 @@ jobs: - arch: 'x64' type: 'cpu' pip_args: '' + - arch: 'x64' + type: 'zluda' + pip_args: '' runs-on: windows-latest env: artifact_name: win32-${{ matrix.build.arch }}-${{ matrix.build.type }}.tar.br python_url: 'https://github.com/indygreg/python-build-standalone/releases/download/20241016/cpython-3.11.10+20241016-x86_64-pc-windows-msvc-shared-install_only_stripped.tar.gz' pip_args: ${{ matrix.build.pip_args }} -r requirements.${{ matrix.build.type }}.txt + zluda_url: 'https://github.com/lshqqytiger/ZLUDA/releases/download/rel.c0804ca624963aab420cb418412b1c7fbae3454b/ZLUDA-windows-rocm5-amd64.zip' steps: - uses: actions/checkout@v4 @@ -143,6 +147,15 @@ jobs: - name: Install packages run: .\python\python.exe -m pip install --no-compile ${{ env.pip_args }} + - name: Patch for ZLUDA + if: matrix.build.type == 'zluda' + run: | + curl -L -o zluda.zip ${{ env.zluda_url }} + unzip zluda.zip + Copy-Item -Force zluda/cublas.dll python/Lib/site-packages/torch/lib/cublas64_11.dll + Copy-Item -Force zluda/cusparse.dll python/Lib/site-packages/torch/lib/cusparse64_11.dll + Copy-Item -Force zluda/nvrtc.dll python/Lib/site-packages/torch/lib/nvrtc64_112_0.dll + - name: Clean up run: | rm -r -fo python/Lib/site-packages/torch/include diff --git a/requirements.zluda.txt b/requirements.zluda.txt new file mode 100644 index 0000000..d8b9efa --- /dev/null +++ b/requirements.zluda.txt @@ -0,0 +1,5 @@ +--extra-index-url https://download.pytorch.org/whl/cu118 +-r requirements.txt +torch==2.3.0 +torchvision==0.18.0 +torchaudio==2.3.0 \ No newline at end of file