From c0d513fcbf9bde74963a461bf9d2094d1b8b09ec Mon Sep 17 00:00:00 2001 From: DarthAffe Date: Sat, 28 Dec 2024 14:40:58 +0100 Subject: [PATCH] Trying to fix hip and sycl --- .github/workflows/backends.yml | 80 ++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 28 deletions(-) diff --git a/.github/workflows/backends.yml b/.github/workflows/backends.yml index 38ac2d6..959cef3 100644 --- a/.github/workflows/backends.yml +++ b/.github/workflows/backends.yml @@ -32,8 +32,6 @@ jobs: defines: '-DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON' - build: 'cuda12' defines: '-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON' - - build: 'rocm5' - defines: '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS="gfx1100;gfx1102;gfx1030" -DSD_BUILD_SHARED_LIBS=ON' - build: 'vulkan' defines: "-DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON" @@ -55,20 +53,6 @@ jobs: method: network sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]' - - name: Install rocm-toolkit - id: rocm-toolkit - if: ${{ matrix.build == 'rocm5' }} - uses: Cyberhan123/rocm-toolkit@v0.1.0 - with: - rocm: '5.5.0' - - - name: Install Ninja - id: install-ninja - if: ${{ matrix.build == 'rocm5' }} - uses: urkle/action-get-ninja@v1 - with: - version: 1.11.1 - - name: Install Vulkan SDK id: get_vulkan if: ${{ matrix.build == 'vulkan' }} @@ -88,20 +72,11 @@ jobs: - name: Upload artifact id: upload_artifact - if: ${{ matrix.build != 'rocm5' }} uses: actions/upload-artifact@v4.3.1 with: name: windows-${{ matrix.build }} path: .\build\bin\Release\stable-diffusion.dll - - name: Upload artifact Rocm - id: upload_artifact_rocm - if: ${{ matrix.build == 'rocm5' }} - uses: actions/upload-artifact@v4.3.1 - with: - name: windows-${{ matrix.build }} - path: .\build\bin\stable-diffusion.dll - windows-2019: runs-on: windows-2019 @@ -155,8 +130,9 @@ jobs: shell: bash env: - WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7dff44ba-e3af-4448-841c-0d616c8da6e7/w_BaseKit_p_2024.1.0.595_offline.exe - WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel + WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b380d914-366b-4b77-a74a-05e3c38b3514/intel-oneapi-base-toolkit-2025.0.0.882_offline.exe + WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel + ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI" steps: - name: Checkout @@ -191,6 +167,53 @@ jobs: with: name: windows-sycl path: .\build\bin\stable-diffusion.dll + + windows-hip: + runs-on: windows-latest + + strategy: + matrix: + gpu_target: [gfx1100, gfx1101, gfx1030] + + steps: + - name: Install + id: depends + run: | + $ErrorActionPreference = "Stop" + write-host "Downloading AMD HIP SDK Installer" + Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe" + write-host "Installing AMD HIP SDK" + Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait + write-host "Completed AMD HIP SDK installation" + - name: Verify ROCm + id: verify + run: | + & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version + + - name: Checkout + id: checkout + uses: actions/checkout@v4.1.2 + with: + repository: 'leejet/stable-diffusion.cpp' + ref: '${{ github.event.inputs.commit }}' + submodules: recursive + + - name: Build + id: cmake_build + run: | + $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path) + $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}" + mkdir build + cd build + cmake -G "Unix Makefiles" --build .. -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=${{ matrix.gpu_target }} -DGGML_RPC=ON -DSD_BUILD_SHARED_LIBS=ON + cmake --build . --config Release + + - name: Upload artifact + id: upload_artifact + uses: actions/upload-artifact@v4.3.1 + with: + name: windows-hip + path: .\build\bin\stable-diffusion.dll linux: runs-on: ubuntu-latest @@ -305,7 +328,7 @@ jobs: run: | mkdir build cd build - cmake .. -DCMAKE_C_COMPILER=hipcc -DCMAKE_CXX_COMPILER=hipcc -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS="gfx1100;gfx1102;gfx1030" -DSD_BUILD_SHARED_LIBS=ON + cmake .. -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" -DGGML_HIP=ON -DSD_BUILD_SHARED_LIBS=ON cmake --build . --config Release - name: Upload artifact Rocm @@ -359,6 +382,7 @@ jobs: needs: - windows + - windows-hip - windows-sycl - linux - linux-hip