-
Notifications
You must be signed in to change notification settings - Fork 8
161 lines (140 loc) · 6.89 KB
/
test-mlc-script-features.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: MLC script automation features test
on:
pull_request_target:
branches: [ "main", "dev" ]
paths:
- '.github/workflows/test-mlc-script-features.yml'
- '**'
- '!**.md'
jobs:
test_mlc_script_features:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.8"]
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
steps:
- uses: actions/checkout@v4
- 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: Pull MLOps repository
run: |
pip install mlcflow
mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }}
- name: Test Python venv
run: |
mlcr --tags=install,python-venv --name=test --quiet
mlc search cache --tags=get,python,virtual,name-test --quiet
- name: Test variations
run: |
mlcr --tags=get,dataset,preprocessed,imagenet,_NHWC --quiet
mlc search cache --tags=get,dataset,preprocessed,imagenet,-_NCHW
mlc search cache --tags=get,dataset,preprocessed,imagenet,-_NHWC
- name: Test versions
continue-on-error: true
if: runner.os == 'linux'
run: |
mlcr --tags=get,generic-python-lib,_package.scipy --version=1.9.3 --quiet
test $? -eq 0 || exit $?
mlcr --tags=get,generic-python-lib,_package.scipy --version=1.9.2 --quiet
test $? -eq 0 || exit $?
# Need to add find cache here
# mlcr --tags=get,generic-python-lib,_package.scipy --version=1.9.3 --quiet --only_execute_from_cache=True
# test $? -eq 0 || exit 0
- name: Test python install from src
run: |
mlcr --tags=python,src,install,_shared --version=3.9.10 --quiet
mlc search cache --tags=python,src,install,_shared,version-3.9.10
test_docker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.8"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Pull MLOps repository
run: |
pip install mlcflow
mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }}
- name: Run docker container from dockerhub on linux
run: |
mlcr --tags=run,docker,container --adr.compiler.tags=gcc --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --image_name=cm-script-app-image-classification-onnx-py --env.MLC_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.MLC_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.MLC_DOCKER_IMAGE_REPO=cknowledge --quiet
- name: Run docker container locally on linux
run: |
mlcr --tags=run,docker,container --adr.compiler.tags=gcc --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --image_name=mlc-script-app-image-classification-onnx-py --env.MLC_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.MLC_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.MLC_DOCKER_IMAGE_REPO=local --quiet
test_mlperf_retinanet_cpp_venv:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.8"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Pull MLOps repository
run: |
pip install mlcflow
mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }}
- name: Run MLPerf Inference Retinanet with native and virtual Python
run: |
mlcr --tags=app,mlperf,inference,generic,_cpp,_retinanet,_onnxruntime,_cpu --adr.python.version_min=3.8 --adr.compiler.tags=gcc --adr.openimages-preprocessed.tags=_50 --scenario=Offline --mode=accuracy --test_query_count=10 --rerun --quiet
mlcr --tags=app,mlperf,inference,generic,_cpp,_retinanet,_onnxruntime,_cpu --adr.python.version_min=3.8 --adr.compiler.tags=gcc --adr.openimages-preprocessed.tags=_50 --scenario=Offline --mode=performance --test_query_count=10 --rerun --quiet
mlcr --tags=install,python-venv --version=3.10.8 --name=mlperf --quiet
mlcr --tags=run,mlperf,inference,_submission,_short --adr.python.name=mlperf --adr.python.version_min=3.8 --adr.compiler.tags=gcc --adr.openimages-preprocessed.tags=_50 --submitter=MLCommons --implementation=cpp --hw_name=default --model=retinanet --backend=onnxruntime --device=cpu --scenario=Offline --quiet
# Step for Linux/MacOS
- name: Randomly Execute Step (Linux/MacOS)
if: runner.os != 'Windows'
run: |
RANDOM_NUMBER=$((RANDOM % 10))
echo "Random number is $RANDOM_NUMBER"
if [ "$RANDOM_NUMBER" -eq 0 ]; then
echo "run_step=true" >> $GITHUB_ENV
else
echo "run_step=false" >> $GITHUB_ENV
fi
# Step for Windows
- name: Randomly Execute Step (Windows)
if: runner.os == 'Windows'
run: |
$RANDOM_NUMBER = Get-Random -Maximum 10
Write-Host "Random number is $RANDOM_NUMBER"
if ($RANDOM_NUMBER -eq 0) {
Write-Host "run_step=true" | Out-File -FilePath $Env:GITHUB_ENV -Append
} else {
Write-Host "run_step=false" | Out-File -FilePath $Env:GITHUB_ENV -Append
}
- name: Retrieve secrets from Keeper
if: github.repository_owner == 'mlcommons' && env.run_step == 'true'
id: ksecrets
uses: Keeper-Security/ksm-action@master
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |-
ubwkjh-Ii8UJDpG2EoU6GQ/field/Access Token > env:PAT
- name: Push Results
env:
GITHUB_TOKEN: ${{ env.PAT }}
if: github.repository_owner == 'mlcommons' && env.run_step == 'true'
run: |
git config --global user.name "mlcommons-bot"
git config --global user.email "[email protected]"
git config --global credential.https://github.com.helper ""
git config --global credential.https://github.com.helper "!gh auth git-credential"
git config --global credential.https://gist.github.com.helper ""
git config --global credential.https://gist.github.com.helper "!gh auth git-credential"
mlcr --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=auto-update --commit_message="Results from R50 GH action on ${{ matrix.os }}" --quiet