Skip to content

Commit 638ecf1

Browse files
committed
CI: Provide prebuilt windows binary for hip
1 parent 6026da5 commit 638ecf1

File tree

1 file changed

+52
-2
lines changed

1 file changed

+52
-2
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,28 @@ jobs:
966966
path: llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip
967967
name: llama-bin-win-sycl-x64.zip
968968

969+
windows-latest-cmake-hip-calculate-target:
970+
runs-on: windows-latest
971+
outputs:
972+
gpu_targets: ${{ steps.set_gpu_targets.outputs.gpu_targets }}
973+
974+
steps:
975+
- name: Set GPU targets
976+
id: set_gpu_targets
977+
run: |
978+
if ${{ github.event.inputs.create_release == 'true' }}; then
979+
echo 'gpu_targets=["gfx1100", "gfx1101", "gfx1030"]' >> "$GITHUB_OUTPUT"
980+
else
981+
echo 'gpu_targets=["gfx1100"]' >> "$GITHUB_OUTPUT"
982+
fi
983+
969984
windows-latest-cmake-hip:
970985
runs-on: windows-latest
971986

987+
strategy:
988+
matrix:
989+
gpu_target: ${{ fromJSON(needs.hip_gpu_target_calculate.outputs.gpu_targets) }}
990+
972991
steps:
973992
- name: Clone
974993
id: checkout
@@ -994,8 +1013,38 @@ jobs:
9941013
run: |
9951014
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
9961015
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
997-
cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIPBLAS=ON
998-
cmake --build build --config Release
1016+
cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=${{ matrix.gpu_target }} -DGGML_RPC=ON
1017+
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1018+
md "build\bin\rocblas\library\"
1019+
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
1020+
cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
1021+
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
1022+
1023+
- name: Determine tag name
1024+
id: tag
1025+
shell: bash
1026+
run: |
1027+
BUILD_NUMBER="$(git rev-list --count HEAD)"
1028+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1029+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1030+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1031+
else
1032+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1033+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1034+
fi
1035+
1036+
- name: Pack artifacts
1037+
id: pack_artifacts
1038+
if: ${{ github.event.inputs.create_release == 'true' }}
1039+
run: |
1040+
7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
1041+
1042+
- name: Upload artifacts
1043+
if: ${{ github.event.inputs.create_release == 'true' }}
1044+
uses: actions/upload-artifact@v4
1045+
with:
1046+
path: llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
1047+
name: llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
9991048

10001049
ios-xcode-build:
10011050
runs-on: macos-latest
@@ -1060,6 +1109,7 @@ jobs:
10601109
- macOS-latest-cmake
10611110
- windows-latest-cmake
10621111
- windows-latest-cmake-cuda
1112+
- windows-latest-cmake-hip
10631113
- macOS-latest-cmake-arm64
10641114
- macOS-latest-cmake-x64
10651115

0 commit comments

Comments
 (0)