-
Notifications
You must be signed in to change notification settings - Fork 21
56 lines (50 loc) · 1.82 KB
/
benchmark_zentorch_plugin.yaml
File metadata and controls
56 lines (50 loc) · 1.82 KB
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
46
47
48
49
50
51
52
53
54
55
56
name: ZenTorch Plugin - Benchmark
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "benchmarks/zentorch/**/*.py"
- ".github/workflows/benchmark_zentorch_plugin.yaml"
pull_request:
branches: [main]
paths:
- "benchmarks/zentorch/**/*.py"
- ".github/workflows/benchmark_zentorch_plugin.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_and_benchmark:
runs-on: [self-hosted, amd-cpu, epyc, genoa]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Copy zentorch binary to current directory
run: cp
/home/github_actions/actions-runner/zentorch-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
docker/transformers-pytorch-amd-cpu-zentorch/zentorch-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
- name: Build Docker image
run: docker build
--build-arg USER_ID=$(id -u)
--build-arg GROUP_ID=$(id -g)
--tag optimum-amd-zentorch:2.2.1
docker/transformers-pytorch-amd-cpu-zentorch
- name: Run benchmarks
uses: addnab/docker-run-action@v3
env:
HF_WRITE_TOKEN: ${{ secrets.HF_WRITE_TOKEN }}
with:
image: optimum-amd-zentorch:2.2.1
options: |
--rm
--shm-size 64G
--env HF_WRITE_TOKEN
--volume ${{ github.workspace }}:/workspace
--workdir /workspace
run: |
pip install .[zentorch,benchmarks]
huggingface-cli login --token $HF_WRITE_TOKEN
amdrun python benchmarks/zentorch/benchmark_encoder_models.py
amdrun python benchmarks/zentorch/benchmark_text_generation_models.py
amdrun python benchmarks/zentorch/benchmark_image_diffusion_pipelines.py