-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (109 loc) · 4.53 KB
/
test-mlperf-inference-abtf-poc.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: MLPerf Automotive POC Test
on:
pull_request:
branches: [ "main", "dev" ]
paths:
- '.github/workflows/test-mlperf-inference-abtf-poc.yml'
- '**'
- '!**.md'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-24.04, macos-latest, macos-13, windows-latest]
python-version: [ "3.8", "3.12" ]
backend: [ "pytorch" ]
implementation: [ "python" ]
docker: [ "", " --docker --docker_it=no --docker_cm_repo=mlcommons@mlperf-automations --docker_cm_repo_branch=dev --docker_dt=yes" ]
extra-args: [ "--adr.compiler.tags=gcc", "--env.CM_MLPERF_LOADGEN_BUILD_FROM_SRC=off" ]
exclude:
- os: ubuntu-24.04
python-version: "3.8"
- os: windows-latest
python-version: "3.8"
- os: windows-latest
extra-args: "--adr.compiler.tags=gcc"
- os: windows-latest
docker: " --docker --docker_it=no --docker_cm_repo=mlcommons@mlperf-automations --docker_cm_repo_branch=dev --docker_dt=yes"
# windows docker image is not supported in CM yet
- os: macos-latest
python-version: "3.8"
- os: macos-13
python-version: "3.8"
- os: macos-latest
docker: " --docker --docker_it=no --docker_cm_repo=mlcommons@mlperf-automations --docker_cm_repo_branch=dev --docker_dt=yes"
- os: macos-13
docker: " --docker --docker_it=no --docker_cm_repo=mlcommons@mlperf-automations --docker_cm_repo_branch=dev --docker_dt=yes"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Configure git longpaths (Windows)
if: matrix.os == 'windows-latest'
run: |
git config --system core.longpaths true
- name: Install cm4mlops on Windows
if: matrix.os == 'windows-latest'
run: |
$env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops
- name: Install dependencies on Unix Platforms
if: matrix.os != 'windows-latest'
run: |
CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops
- name: Pull MLOps repository
run: |
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }}
#cm pull repo mlcommons@cm4abtf --branch=poc
- name: Install Docker on macos
if: runner.os == 'macOS-deactivated'
run: |
brew update
brew install --cask docker
- name: Start Docker Daemon on macos
if: runner.os == 'macOS-deactivated'
run: |
open /Applications/Docker.app
echo "Starting Docker, this may take a while..."
# Set max attempts and initial wait time
MAX_ATTEMPTS=20
WAIT_TIME=5
# Loop until Docker daemon is up or max attempts reached
attempt=1
while ! docker info > /dev/null 2>&1; do
echo "Attempt $attempt: Waiting for Docker to start..."
sleep $WAIT_TIME
attempt=$((attempt + 1))
WAIT_TIME=$((WAIT_TIME * 2)) # Exponential backoff
if [ $attempt -gt $MAX_ATTEMPTS ]; then
echo "Docker failed to start within the timeout period"
exit 1
fi
done
echo "Docker is up and running"
- name: Install Docker Desktop on Windows
if: runner.os == 'Windows-deactivated'
run: |
choco install docker-desktop --no-progress -y
- name: Start Docker Desktop on Windows
if: runner.os == 'Windows-deactivated'
run: |
Start-Process 'C:\Program Files\Docker\Docker\Docker Desktop.exe'
# Wait until Docker daemon is running
$retryCount = 0
while (!(docker info) -and ($retryCount -lt 10)) {
Write-Output "Waiting for Docker to start..."
Start-Sleep -Seconds 10
$retryCount++
}
if ($retryCount -ge 10) {
throw "Docker failed to start"
}
Write-Output "Docker is up and running"
- name: Test MLPerf Inference ABTF POC using ${{ matrix.backend }} on ${{ matrix.os }}
run: |
cm run script --tags=run-abtf,inference,_poc-demo --test_query_count=2 --adr.cocoeval.version_max=1.5.7 --adr.cocoeval.version_max_usable=1.5.7 --quiet ${{ matrix.extra-args }} ${{ matrix.docker }} -v