Skip to content

Add support for amd-smi to perform device isolation #85

Add support for amd-smi to perform device isolation

Add support for amd-smi to perform device isolation #85

name: Pytorch CUDA Tests
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_image_and_run_gpu_tests:
runs-on: hf-dgx-01
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
run: docker build
--file docker/cuda.dockerfile
--build-arg USER_ID=$(id -u)
--build-arg GROUP_ID=$(id -g)
--build-arg CUDA_VERSION=12.1.1
--build-arg TORCH_CUDA=cu121
--tag opt-bench-cuda:12.1.1
.
- name: Run tests
run: docker run
--rm
--entrypoint /bin/bash
--env USE_CUDA="1"
--gpus '"device=0,1"'
--volume $(pwd):/workspace/optimum-benchmark
--workdir /workspace/optimum-benchmark
opt-bench-cuda:12.1.1
-c "pip install -e .[test,peft,diffusers] && pytest -k 'cuda and pytorch' -x"