@@ -596,17 +596,113 @@ jobs:
596596 path : llama-bin-win-sycl-x64.zip
597597 name : llama-bin-win-sycl-x64.zip
598598
599+ ubuntu-22-rocm :
600+ runs-on : ubuntu-22.04
601+
602+ strategy :
603+ matrix :
604+ include :
605+ - ROCM_VERSION : " 7.2"
606+ gpu_targets : " gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1151;gfx1150;gfx1200;gfx1201"
607+ build : ' x64'
608+
609+ steps :
610+ - name : Clone
611+ id : checkout
612+ uses : actions/checkout@v6
613+ with :
614+ fetch-depth : 0
615+
616+ - name : ccache
617+ uses : ggml-org/ccache-action@v1.2.16
618+ with :
619+ key : ubuntu-rocm-cmake-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}
620+ evict-old-files : 1d
621+
622+ - name : Dependencies
623+ id : depends
624+ run : |
625+ sudo apt install -y build-essential git cmake wget
626+
627+ - name : Setup Legacy ROCm
628+ if : matrix.ROCM_VERSION == '7.2'
629+ id : legacy_env
630+ run : |
631+ sudo mkdir --parents --mode=0755 /etc/apt/keyrings
632+ wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
633+ gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
634+
635+ sudo tee /etc/apt/sources.list.d/rocm.list << EOF
636+ deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${{ matrix.ROCM_VERSION }} jammy main
637+ EOF
638+
639+ sudo tee /etc/apt/preferences.d/rocm-pin-600 << EOF
640+ Package: *
641+ Pin: release o=repo.radeon.com
642+ Pin-Priority: 600
643+ EOF
644+
645+ sudo apt update
646+ sudo apt-get install -y libssl-dev rocm-hip-sdk
647+
648+ - name : Setup TheRock
649+ if : matrix.ROCM_VERSION != '7.2'
650+ id : therock_env
651+ run : |
652+ wget https://repo.amd.com/rocm/tarball/therock-dist-linux-gfx1151-${{ matrix.ROCM_VERSION }}.tar.gz
653+ mkdir install
654+ tar -xf *.tar.gz -C install
655+ export ROCM_PATH=$(pwd)/install
656+ echo ROCM_PATH=$ROCM_PATH >> $GITHUB_ENV
657+ echo PATH=$PATH:$ROCM_PATH/bin >> $GITHUB_ENV
658+ echo LD_LIBRARY_PATH=$ROCM_PATH/lib:$ROCM_PATH/llvm/lib:$ROCM_PATH/lib/rocprofiler-systems >> $GITHUB_ENV
659+
660+ - name : Build with native CMake HIP support
661+ id : cmake_build
662+ run : |
663+ cmake -B build -S . \
664+ -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
665+ -DCMAKE_HIP_FLAGS="-mllvm --amdgpu-unroll-threshold-local=600" \
666+ -DCMAKE_BUILD_TYPE=Release \
667+ -DGGML_BACKEND_DL=ON \
668+ -DGGML_NATIVE=OFF \
669+ -DCMAKE_INSTALL_RPATH='$ORIGIN' \
670+ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
671+ -DGGML_CPU_ALL_VARIANTS=ON \
672+ -DGPU_TARGETS="${{ matrix.gpu_targets }}" \
673+ -DGGML_HIP=ON \
674+ -DHIP_PLATFORM=amd \
675+ -DGGML_HIP_ROCWMMA_FATTN=ON \
676+ ${{ env.CMAKE_ARGS }}
677+ cmake --build build --config Release -j $(nproc)
678+
679+ - name : Determine tag name
680+ id : tag
681+ uses : ./.github/actions/get-tag-name
682+
683+ - name : Pack artifacts
684+ id : pack_artifacts
685+ run : |
686+ cp LICENSE ./build/bin/
687+ tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .
688+
689+ - name : Upload artifacts
690+ uses : actions/upload-artifact@v6
691+ with :
692+ path : llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}.tar.gz
693+ name : llama-bin-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}.tar.gz
694+
599695 windows-hip :
600696 runs-on : windows-2022
601697
602698 env :
603- HIPSDK_INSTALLER_VERSION : " 25.Q3 "
699+ HIPSDK_INSTALLER_VERSION : " 26.Q1 "
604700
605701 strategy :
606702 matrix :
607703 include :
608704 - name : " radeon"
609- gpu_targets : " gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
705+ gpu_targets : " gfx1150; gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
610706
611707 steps :
612708 - name : Clone
@@ -616,7 +712,7 @@ jobs:
616712 - name : Grab rocWMMA package
617713 id : grab_rocwmma
618714 run : |
619- curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.0.1 /pool/main/r/rocwmma-dev/rocwmma-dev_2.0 .0.70001-42 ~24.04_amd64.deb"
715+ curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.2 /pool/main/r/rocwmma-dev/rocwmma-dev_2.2 .0.70200-43 ~24.04_amd64.deb"
620716 7z x rocwmma.deb
621717 7z x data.tar
622718
@@ -639,7 +735,7 @@ jobs:
639735 run : |
640736 $ErrorActionPreference = "Stop"
641737 write-host "Downloading AMD HIP SDK Installer"
642- 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"
738+ Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-Win11 -For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
643739 write-host "Installing AMD HIP SDK"
644740 $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
645741 $completed = $proc.WaitForExit(600000)
@@ -673,20 +769,20 @@ jobs:
673769 cmake -G "Unix Makefiles" -B build -S . `
674770 -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
675771 -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
676- -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-7.0.1 /include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
772+ -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-7.2.0 /include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
677773 -DCMAKE_BUILD_TYPE=Release `
678774 -DGGML_BACKEND_DL=ON `
679775 -DGGML_NATIVE=OFF `
680776 -DGGML_CPU=OFF `
681- -DAMDGPU_TARGETS ="${{ matrix.gpu_targets }}" `
777+ -DGPU_TARGETS ="${{ matrix.gpu_targets }}" `
682778 -DGGML_HIP_ROCWMMA_FATTN=ON `
683779 -DGGML_HIP=ON `
684780 -DLLAMA_BUILD_BORINGSSL=ON
685781 cmake --build build --target ggml-hip -j ${env:NUMBER_OF_PROCESSORS}
686782 md "build\bin\rocblas\library\"
687783 md "build\bin\hipblaslt\library"
688- cp "${env:HIP_PATH}\bin\hipblas .dll" "build\bin\"
689- cp "${env:HIP_PATH}\bin\hipblaslt .dll" "build\bin\"
784+ cp "${env:HIP_PATH}\bin\libhipblas .dll" "build\bin\"
785+ cp "${env:HIP_PATH}\bin\libhipblaslt .dll" "build\bin\"
690786 cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
691787 cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
692788 cp "${env:HIP_PATH}\bin\hipblaslt\library\*" "build\bin\hipblaslt\library\"
@@ -864,6 +960,7 @@ jobs:
864960 - windows-cuda
865961 - windows-sycl
866962 - windows-hip
963+ - ubuntu-22-rocm
867964 - ubuntu-22-cpu
868965 - ubuntu-22-vulkan
869966 - ubuntu-24-openvino
@@ -949,6 +1046,7 @@ jobs:
9491046 **Linux:**
9501047 - [Ubuntu x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.tar.gz)
9511048 - [Ubuntu x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz)
1049+ - [Ubuntu x64 (ROCm 7.2)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-7.2-x64.tar.gz)
9521050 - [Ubuntu s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-s390x.tar.gz)
9531051 - [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ needs.ubuntu-24-openvino.outputs.openvino_version }}-x64.tar.gz)
9541052
0 commit comments