77 description : " Create new release"
88 required : true
99 type : boolean
10- push :
11- branches :
12- - master
13- - ci
14- paths :
15- [
16- " .github/workflows/**" ,
17- " **/CMakeLists.txt" ,
18- " **/Makefile" ,
19- " **/*.h" ,
20- " **/*.hpp" ,
21- " **/*.c" ,
22- " **/*.cpp" ,
23- " **/*.cu" ,
24- ]
25- pull_request :
26- types : [opened, synchronize, reopened]
27- paths :
28- [
29- " **/CMakeLists.txt" ,
30- " **/Makefile" ,
31- " **/*.h" ,
32- " **/*.hpp" ,
33- " **/*.c" ,
34- " **/*.cpp" ,
35- " **/*.cu" ,
36- ]
10+ # push:
11+ # branches:
12+ # - master
13+ # - ci
14+ # paths:
15+ # [
16+ # ".github/workflows/**",
17+ # "**/CMakeLists.txt",
18+ # "**/Makefile",
19+ # "**/*.h",
20+ # "**/*.hpp",
21+ # "**/*.c",
22+ # "**/*.cpp",
23+ # "**/*.cu",
24+ # ]
25+ # pull_request:
26+ # types: [opened, synchronize, reopened]
27+ # paths:
28+ # [
29+ # "**/CMakeLists.txt",
30+ # "**/Makefile",
31+ # "**/*.h",
32+ # "**/*.hpp",
33+ # "**/*.c",
34+ # "**/*.cpp",
35+ # "**/*.cu",
36+ # ]
3737
3838env :
3939 BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
@@ -164,8 +164,6 @@ jobs:
164164 defines : " -DGGML_NATIVE=OFF -DGGML_AVX512=ON -DGGML_AVX=ON -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
165165 - build : " cuda12"
166166 defines : " -DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES=90;89;86;80;75"
167- # - build: "rocm5.5"
168- # 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'
169167 - build : ' vulkan'
170168 defines : " -DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON"
171169 steps :
@@ -184,19 +182,12 @@ jobs:
184182 method : " network"
185183 sub-packages : ' ["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
186184
187- - name : Install rocm-toolkit
188- id : rocm-toolkit
189- if : ${{ matrix.build == 'rocm5.5' }}
190- uses : Cyberhan123/rocm-toolkit@v0.1.0
185+ - name : ccache
186+ uses : ggml-org/ccache-action@v1.2.16
191187 with :
192- rocm : " 5.5.0"
188+ key : windows-latest-cmake-${{ matrix.build }}-${{ env.HIPSDK_INSTALLER_VERSION }}-x64
189+ evict-old-files : 1d
193190
194- - name : Install Ninja
195- id : install-ninja
196- if : ${{ matrix.build == 'rocm5.5' }}
197- uses : urkle/action-get-ninja@v1
198- with :
199- version : 1.11.1
200191 - name : Install Vulkan SDK
201192 id : get_vulkan
202193 if : ${{ matrix.build == 'vulkan' }} https://sdk.lunarg.com/sdk/download/1.4.328.1/windows/vulkansdk-windows-X64-1.4.328.1.exe
@@ -277,6 +268,103 @@ jobs:
277268 path : |
278269 sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
279270
271+ windows-latest-cmake-hip :
272+ runs-on : windows-2022
273+
274+ env :
275+ HIPSDK_INSTALLER_VERSION : " 25.Q3"
276+ GPU_TARGETS : " gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
277+
278+ steps :
279+ - uses : actions/checkout@v3
280+ with :
281+ submodules : recursive
282+
283+ - name : Cache ROCm Installation
284+ id : cache-rocm
285+ uses : actions/cache@v4
286+ with :
287+ path : C:\Program Files\AMD\ROCm
288+ key : rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
289+
290+ - name : ccache
291+ uses : ggml-org/ccache-action@v1.2.16
292+ with :
293+ key : windows-latest-cmake-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-x64
294+ evict-old-files : 1d
295+
296+ - name : Install ROCm
297+ if : steps.cache-rocm.outputs.cache-hit != 'true'
298+ run : |
299+ $ErrorActionPreference = "Stop"
300+ write-host "Downloading AMD HIP SDK Installer"
301+ Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
302+ write-host "Installing AMD HIP SDK"
303+ $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
304+ $completed = $proc.WaitForExit(600000)
305+ if (-not $completed) {
306+ Write-Error "ROCm installation timed out after 10 minutes. Killing the process"
307+ $proc.Kill()
308+ exit 1
309+ }
310+ if ($proc.ExitCode -ne 0) {
311+ Write-Error "ROCm installation failed with exit code $($proc.ExitCode)"
312+ exit 1
313+ }
314+ write-host "Completed AMD HIP SDK installation"
315+
316+ - name : Verify ROCm
317+ run : |
318+ # Find and test ROCm installation
319+ $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1
320+ if (-not $clangPath) {
321+ Write-Error "ROCm installation not found"
322+ exit 1
323+ }
324+ & $clangPath.FullName --version
325+ # Set HIP_PATH environment variable for later steps
326+ echo "HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)" >> $env:GITHUB_ENV
327+
328+ - name : Build
329+ run : |
330+ mkdir build
331+ cd build
332+ $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
333+ cmake .. `
334+ -G "Unix Makefiles" `
335+ -DGGML_NATIVE=OFF `
336+ -DCMAKE_C_COMPILER=clang `
337+ -DCMAKE_CXX_COMPILER=clang++ `
338+ -DCMAKE_BUILD_TYPE=Release `
339+ -DSD_HIPBLAS=ON `
340+ -DSD_BUILD_SHARED_LIBS=ON `
341+ -DGPU_TARGETS="${{ env.GPU_TARGETS }}"
342+ cmake --build . --config Release --parallel ${env:NUMBER_OF_PROCESSORS}
343+
344+ - name : Get commit hash
345+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
346+ uses : pr-mpt/actions-commit-hash@v2
347+
348+ - name : Pack artifacts
349+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
350+ run : |
351+ md "build\bin\rocblas\library\"
352+ md "build\bin\hipblaslt\library"
353+ cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
354+ cp "${env:HIP_PATH}\bin\hipblaslt.dll" "build\bin\"
355+ cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
356+ cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
357+ cp "${env:HIP_PATH}\bin\hipblaslt\library\*" "build\bin\hipblaslt\library\"
358+ 7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-x64.zip .\build\bin\*
359+
360+ - name : Upload artifacts
361+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
362+ uses : actions/upload-artifact@v4
363+ with :
364+ name : sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-x64.zip
365+ path : |
366+ sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-x64.zip
367+
280368 release :
281369 if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
282370
@@ -286,6 +374,7 @@ jobs:
286374 - ubuntu-latest-cmake
287375 - macOS-latest-cmake
288376 - windows-latest-cmake
377+ - windows-latest-cmake-hip
289378
290379 steps :
291380 - name : Clone
0 commit comments