Skip to content

ci: install lsb-release for ROCm wheels #2

ci: install lsb-release for ROCm wheels

ci: install lsb-release for ROCm wheels #2

Workflow file for this run

name: Wheels ROCm
on:
workflow_dispatch:
inputs:
amdgpu_targets:
description: AMDGPU targets to compile into the ROCm wheel
required: false
default: gfx1030
push:
branches:
- ci/validate-rocm-wheels
tags:
- "v*"
permissions:
contents: write
jobs:
build_wheels:
name: Build Wheel ${{ matrix.os }} ${{ matrix.pyver }} ROCm ${{ matrix.rocm }}
runs-on: ${{ matrix.os }}
container:
image: rocm/dev-ubuntu-22.04:${{ matrix.rocm }}-complete
strategy:
matrix:
include:
- os: ubuntu-22.04
pyver: "3.9"
rocm: "7.2.4"
amdgpu_targets: gfx1030
steps:
- name: Install system dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends git cmake lsb-release ninja-build
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build wheel
- name: Build wheel
env:
MATRIX_AMDGPU_TARGETS: ${{ matrix.amdgpu_targets }}
INPUT_AMDGPU_TARGETS: ${{ inputs.amdgpu_targets }}
run: |
export ROCM_PATH="${ROCM_PATH:-/opt/rocm}"
export HIP_PATH="${HIP_PATH:-$ROCM_PATH}"
export PATH="$ROCM_PATH/bin:$ROCM_PATH/llvm/bin:$PATH"
export LD_LIBRARY_PATH="$ROCM_PATH/lib:$ROCM_PATH/lib64:${LD_LIBRARY_PATH:-}"
export CC="$ROCM_PATH/llvm/bin/clang"
export CXX="$ROCM_PATH/llvm/bin/clang++"
export HIPCXX="$ROCM_PATH/llvm/bin/clang"
export CMAKE_GENERATOR=Ninja
hipconfig --version
hipcc --version
rocm_tag="$(hipconfig --version | sed -E 's/^([0-9]+)\.([0-9]+).*/\1\2/')"
echo "ROCM_VERSION=$rocm_tag" >> "$GITHUB_ENV"
amdgpu_targets="${INPUT_AMDGPU_TARGETS:-$MATRIX_AMDGPU_TARGETS}"
export CMAKE_ARGS="-DGGML_HIP=on -DGGML_NATIVE=off -DGGML_AVX=off -DGGML_AVX2=off -DGGML_FMA=off -DGGML_F16C=off -DAMDGPU_TARGETS=$amdgpu_targets -DCMAKE_HIP_ARCHITECTURES=$amdgpu_targets"
python -m build --wheel
- uses: actions/upload-artifact@v4
with:
name: wheels-rocm${{ env.ROCM_VERSION }}-${{ matrix.os }}
path: dist/*.whl
- uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
# Set tag_name to <tag>-rocm<rocm_version>.
tag_name: ${{ github.ref_name }}-rocm${{ env.ROCM_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}