@@ -186,9 +186,8 @@ jobs:
186186 defines : ' -DRWKV_AVX512=ON'
187187 - build : ' cuda12'
188188 defines : ' -DRWKV_CUBLAS=ON'
189- - build : ' rocm5.5'
190- defines : ' -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DRWKV_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS="gfx1100;gfx1102;gfx1030"'
191-
189+ - build : ' hip'
190+ defines : ' '
192191 steps :
193192 - name : Clone
194193 id : checkout
@@ -206,25 +205,52 @@ jobs:
206205
207206 - name : Install rocm-toolkit
208207 id : rocm-toolkit
209- if : ${{ matrix.build == 'rocm5.5' }}
210- uses : Cyberhan123/rocm-toolkit@v0.1.0
211- with :
212- rocm : ' 5.5.0'
208+ if : ${{ matrix.build == 'hip' }}
209+ run : |
210+ $ErrorActionPreference = "Stop"
211+ write-host "Downloading AMD HIP SDK Installer"
212+ 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"
213+ write-host "Installing AMD HIP SDK"
214+ Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
215+ write-host "Completed AMD HIP SDK installation"
216+
217+ - name : Verify ROCm
218+ id : rocm-verify
219+ if : ${{ matrix.build == 'hip' }}
220+ run : |
221+ & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
213222
214223 - name : Install Ninja
215224 id : install-ninja
216- if : ${{ matrix.build == 'rocm5.5 ' }}
225+ if : ${{ matrix.build == 'hip ' }}
217226 uses : urkle/action-get-ninja@v1
218227 with :
219228 version : 1.11.1
220229
230+ - name : Install ccache
231+ uses : hendrikmuhs/ccache-action@v1.2
232+ with :
233+ key : ${{ github.job }}
234+
221235 - name : Build
222236 id : cmake_build
237+ if : ${{ matrix.build != 'hip' }}
223238 run : |
224239 mkdir build
225240 cd build
226241 cmake .. ${{ matrix.defines }}
227- cmake --build . --config Release
242+ cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
243+
244+ - name : Build-hip
245+ id : cmake_build_hip
246+ if : ${{ matrix.build == 'hip' }}
247+ run : |
248+ mkdir build
249+ cd build
250+ $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
251+ $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
252+ cmake .. -G "Unix Makefiles" -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DRWKV_HIPBLAS=ON -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release
253+ cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
228254
229255 - name : Check AVX512F support
230256 id : check_avx512f
@@ -242,7 +268,7 @@ jobs:
242268 - name : Test
243269 id : cmake_test
244270 # Test AVX-512 only when possible
245- if : ${{ (matrix.build != 'avx512' || env.HAS_AVX512F == '1') && matrix.build != 'cuda12' && matrix.build != 'rocm5.5 '}}
271+ if : ${{ (matrix.build != 'avx512' || env.HAS_AVX512F == '1') && matrix.build != 'cuda12' && matrix.build != 'hip '}}
246272 run : |
247273 cd build
248274 ctest -C Release --verbose
0 commit comments