Skip to content

Add llama.cpp backend (#231) #555

Add llama.cpp backend (#231)

Add llama.cpp backend (#231) #555

name: API ROCm Tests
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/test_api_rocm.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_api_rocm.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
env:
IMAGE: ghcr.io/huggingface/optimum-benchmark:latest-rocm
jobs:
build_image_and_run_api_rocm_tests:
runs-on: [single-gpu, amd-gpu, mi250, ci]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set target devices
run: |
echo "DEVICE:$DEVICE"
echo "DEVICE=$DEVICE" >> $GITHUB_ENV
- name: Unroot docker image
run: |
docker build --build-arg IMAGE=${{ env.IMAGE }} --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) -t ${{ env.IMAGE }}-unroot docker/unroot
- name: Run tests
uses: addnab/docker-run-action@v3
env:
DEVICE: ${{ env.DEVICE }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
PUSH_REPO_ID: optimum-benchmark/rocm
with:
image: ${{ env.IMAGE }}-unroot
options: |
--rm
--shm-size 64G
--env HF_TOKEN
--env PUSH_REPO_ID
--device /dev/kfd
--device /dev/dri/${{ env.DEVICE }}
--volume ${{ github.workspace }}:/workspace
--workdir /workspace
run: |
pip install -e .[testing,timm,diffusers,codecarbon]
pytest -s -x -k "api and cuda"