still execute python after python installation crash #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wheels (ROCm) (Linux) | ||
on: workflow_dispatch | ||
permissions: | ||
contents: write | ||
jobs: | ||
define_matrix: | ||
name: Define Build Matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Define Job Output | ||
id: set-matrix | ||
run: | | ||
matrix=$(cat << 'EOL' | ||
{"os":["ubuntu-22.04"],"pyver":["3.11"],"rocm":["6.0.2"],"releasetag":["basic"]} | ||
EOL | ||
) | ||
echo "matrix=$matrix" >> $GITHUB_OUTPUT | ||
shell: bash | ||
build_wheels: | ||
name: Build Wheel ${{ matrix.os }} ${{ matrix.pyver }} ROCm ${{ matrix.rocm }} ${{ matrix.releasetag }} | ||
needs: define_matrix | ||
runs-on: ${{ matrix.os }} | ||
container: rocm/dev-ubuntu-22.04:${{ matrix.rocm }} | ||
strategy: | ||
matrix: ${{ fromJSON(needs.define_matrix.outputs.matrix) }} | ||
env: | ||
ROCMVER: ${{ matrix.rocm }} | ||
AVXVER: ${{ matrix.releasetag }} | ||
steps: | ||
- name: Install git on container | ||
run: | | ||
apt update | ||
apt install -y git\ | ||
- name: Install lsb-release | ||
run: sudo apt-get update && sudo apt-get install -y lsb-release | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
continue-on-error: true | ||
id: setup-python | ||
with: | ||
python-version: ${{ matrix.pyver }} | ||
cache: "pip" | ||
- name: Debug Python installation | ||
if: always() | ||
run: | | ||
echo "Python setup exit code: ${{ steps.setup-python.outcome }}" | ||
echo "Python location: ${{ env.pythonLocation }}" | ||
ls -la ${{ env.pythonLocation }}/bin || echo "Python bin directory not found" | ||
${{ env.pythonLocation }}/bin/python --version || echo "Python not found" | ||
${{ env.pythonLocation }}/bin/pip --version || echo "Pip not found" | ||
echo "PATH: $PATH" | ||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev | ||
python -m pip install build wheel | ||
- name: Build Wheel with native CMake HIP support | ||
run: | | ||
export ROCM_PATH=/opt/rocm | ||
export HIP_PATH=$ROCM_PATH/hip | ||
export PATH=$ROCM_PATH/bin:$PATH | ||
export LD_LIBRARY_PATH=$ROCM_PATH/lib:$LD_LIBRARY_PATH | ||
export VERBOSE=1 | ||
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) | ||
export CMAKE_ARGS='-DGGML_HIPBLAS=ON -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang"' | ||
export CMAKE_ARGS="$CMAKE_ARGS -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF" | ||
python -m build --wheel | ||
- name: Build Wheel with legacy HIP support | ||
run: | | ||
export ROCM_PATH=/opt/rocm | ||
export HIP_PATH=$ROCM_PATH/hip | ||
export PATH=$ROCM_PATH/bin:$PATH | ||
export LD_LIBRARY_PATH=$ROCM_PATH/lib:$LD_LIBRARY_PATH | ||
export VERBOSE=1 | ||
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) | ||
export CMAKE_ARGS='-DGGML_HIPBLAS=ON -DCMAKE_C_COMPILER=hipcc -DCMAKE_CXX_COMPILER=hipcc' | ||
export CMAKE_ARGS="$CMAKE_ARGS -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF" | ||
python -m build --wheel | ||
- name: Prepare Release | ||
run: | | ||
ROCM_VERSION=$(echo $ROCMVER | tr -d '.') | ||
echo "ROCM_VERSION=$ROCM_VERSION" >> $GITHUB_ENV | ||
- uses: softprops/action-gh-release@v2 | ||
with: | ||
files: dist/* | ||
tag_name: ${{ github.ref_name }}-rocm${{ env.ROCM_VERSION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# name: Build Wheels (ROCm) (Linux) | ||
# on: workflow_dispatch | ||
# permissions: | ||
# contents: write | ||
# jobs: | ||
# define_matrix: | ||
# name: Define Build Matrix | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
# defaults: | ||
# run: | ||
# shell: pwsh | ||
# steps: | ||
# - name: Define Job Output | ||
# id: set-matrix | ||
# run: | | ||
# $matrix = @{ | ||
# 'os' = @('ubuntu-22.04') | ||
# 'pyver' = @("3.7", "3.8", "3.9", "3.10", "3.11", "3.12") | ||
# 'rocm' = @("6.0.2") | ||
# 'releasetag' = @("basic") | ||
# } | ||
# $matrixOut = ConvertTo-Json $matrix -Compress | ||
# Write-Output ('matrix=' + $matrixOut) >> $env:GITHUB_OUTPUT | ||
# build_wheels: | ||
# name: Build Wheel ${{ matrix.os }} ${{ matrix.pyver }} ROCm ${{ matrix.rocm }} ${{ matrix.releasetag }} | ||
# needs: define_matrix | ||
# runs-on: ${{ matrix.os }} | ||
# container: rocm/dev-ubuntu-22.04:${{ matrix.rocm }} | ||
# strategy: | ||
# matrix: ${{ fromJSON(needs.define_matrix.outputs.matrix) }} | ||
# defaults: | ||
# run: | ||
# shell: bash | ||
# env: | ||
# ROCMVER: ${{ matrix.rocm }} | ||
# AVXVER: ${{ matrix.releasetag }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# submodules: "recursive" | ||
# - name: Setup Python | ||
# run: | | ||
# python3 -m pip install --upgrade pip | ||
# python3 -m pip install build wheel | ||
# - name: Install Dependencies | ||
# run: | | ||
# apt-get update | ||
# apt-get install -y build-essential git cmake rocblas-dev hipblas-dev | ||
# - name: Build Wheel | ||
# run: | | ||
# export ROCM_PATH=/opt/rocm | ||
# export HIP_PATH=$ROCM_PATH/hip | ||
# export PATH=$ROCM_PATH/bin:$PATH | ||
# export LD_LIBRARY_PATH=$ROCM_PATH/lib:$LD_LIBRARY_PATH | ||
# export VERBOSE=1 | ||
# export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) | ||
# export CMAKE_ARGS='-DGGML_HIPBLAS=ON -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang"' | ||
# export CMAKE_ARGS="$CMAKE_ARGS -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_F16C=OFF" | ||
# python3 -m build --wheel | ||
# - name: Extract ROCm Version | ||
# run: | | ||
# ROCM_VERSION=$(echo $ROCMVER | sed 's/\.//g') | ||
# echo "ROCM_VERSION=$ROCM_VERSION" >> $GITHUB_ENV | ||
# - uses: softprops/action-gh-release@v2 | ||
# with: | ||
# files: dist/* | ||
# tag_name: ${{ github.ref_name }}-rocm${{ env.ROCM_VERSION }} | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |