-
Notifications
You must be signed in to change notification settings - Fork 52
45 lines (39 loc) · 1.44 KB
/
test_cli_tensorrt_onnxruntime.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: CLI TensorRT OnnxRuntime Tests
on:
workflow_dispatch:
push:
branches: [main]
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_cli_tensorrt_onnxruntime_tests:
runs-on: nvidia-gpu
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build image
run: docker build
--file docker/tensorrt.dockerfile
--build-arg USER_ID=$(id -u)
--build-arg GROUP_ID=$(id -g)
--tag opt-bench-tensorrt:latest
.
- name: Get GPUs with most free memory
id: get_devices
run: |
echo "::set-output name=devices::$(nvidia-smi --query-gpu=memory.free,index --format=csv,noheader,nounits | sort -n -k1 | tail -n 2 | awk -F', ' '{print $2}' | xargs echo -n | sed 's/ /,/g' | awk '{print $0}')"
- name: Run tests
run: docker run
--rm
--pid host
--shm-size 64G
--env USE_CUDA="1"
--gpus '"device=${{ steps.get_devices.outputs.devices }}"'
--volume $(pwd):/workspace/optimum-benchmark
--workdir /workspace/optimum-benchmark
--entrypoint /bin/bash
opt-bench-tensorrt:latest
-c "pip install -e .[testing,onnxruntime-gpu,diffusers,timm] && pytest -k 'cli and tensorrt and onnxruntime' -x"