-
Notifications
You must be signed in to change notification settings - Fork 138
188 lines (177 loc) · 9.35 KB
/
Copy pathperformance.yaml
File metadata and controls
188 lines (177 loc) · 9.35 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: MIGraphX Performance Tests
on:
pull_request_target:
branches: [develop]
types: [opened, synchronize, closed, labeled]
schedule:
- cron: "0 7 * * 1-6"
workflow_dispatch:
inputs:
rocm_release:
description: ROCm Version
required: true
default: '7.2.3'
performance_reports_repo:
description: Repository where performance reports are stored
required: true
default: 'ROCm/migraphx-reports'
benchmark_utils_repo:
description: Repository where benchmark utils are stored
required: true
default: "ROCm/migraphx-benchmark-utils"
organization:
description: Organization based on which location of files will be different
required: true
default: "AMD"
result_number:
description: Last N results
required: true
default: '10'
model_timeout:
description: If model in performance test script passes this threshold, it will be skipped
required: true
default: '30m'
performance_backup_repo:
description: Repository for backup
required: true
default: migraphx-benchmark/performance-backup
flags:
description: -m for Max value; -s for Std dev; -r for Threshold file
required: true
default: '-r'
model_path:
description: Host path to NFS-backed models (ARC runner mount)
required: false
default: "/migraphx-models"
perf_workspace:
description: Writable NFS-backed workspace for reports/scratch (ARC runner mount)
required: false
default: "/mnt/migraphx-perf-work"
runner_label:
description: Self-hosted runner label (ARC scale set linux-migraphx-mi250-1)
required: false
default: "linux-migraphx-mi250-1"
concurrency:
group: "perftest-${{ github.head_ref || github.base_ref || 'schedule' }}"
cancel-in-progress: true
env:
# Defaults when not overridden by config.md or workflow_dispatch
MIGRAPHX_MODEL_PATH_DEFAULT: /migraphx-models
MIGRAPHX_PERF_WORKSPACE_DEFAULT: /mnt/migraphx-perf-work
MIGRAPHX_RUNNER_LABEL: linux-migraphx-mi250-1
jobs:
security_gate:
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
is_ok_to_test: ${{ steps.gate.outputs.is_ok_to_test }}
steps:
- name: Security gate
id: gate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${{ github.event_name }}" == 'schedule' || "${{ github.event_name }}" == 'workflow_dispatch' || "${{ github.event.action }}" == 'closed'
|| "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}"
|| "${{ github.event.pull_request.author_association }}" =~ ^(OWNER|COLLABORATOR|MEMBER)$ ]]; then
echo "Internal/trusted; APPROVED"
echo "is_ok_to_test=true" >> $GITHUB_OUTPUT
exit 0
fi
if [[ "${{ github.event.action }}" == 'opened' ]]; then
echo "::notice::New external PR opened. Adding external-contributor label."
gh pr edit ${{ github.event.pull_request.number }} --add-label "external-contributor" --repo ${{ github.repository }} || true
gh pr comment ${{ github.event.pull_request.number }} --body "Thank you for your contribution! Since this is an external pull request, a maintainer must review PR and add the \"ok-to-test\" label if it is approved for testing." --repo ${{ github.repository }} || true
fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }}" != "true" ]]; then
echo "Missing 'ok-to-test' label; BLOCKED"
echo "is_ok_to_test=false" >> $GITHUB_OUTPUT
exit 1
fi
if [[ "${{ github.event.action }}" == 'synchronize' ]]; then
echo "::error::New commits pushed. Removing ok-to-test label and blocking until review. Please re-review new changes that were pushed and add ok-to-test label again if changes are approved for testing."
gh pr edit ${{ github.event.pull_request.number }} --remove-label "ok-to-test" --repo ${{ github.repository }} || true
echo "is_ok_to_test=false" >> $GITHUB_OUTPUT
exit 1
fi
echo "External PR approved for testing"
echo "is_ok_to_test=true" >> $GITHUB_OUTPUT
get_config:
needs: security_gate
runs-on: ubuntu-latest
if: needs.security_gate.outputs.is_ok_to_test == 'true'
outputs:
rocm_version: ${{ steps.read_config.outputs.rocm_version }}
utils_repo: ${{ steps.read_config.outputs.utils_repo }}
reports_repo: ${{ steps.read_config.outputs.reports_repo }}
backup_repo: ${{ steps.read_config.outputs.backup_repo }}
repo_org: ${{ steps.read_config.outputs.repo_org }}
perf_number: ${{ steps.read_config.outputs.perf_number }}
perf_flag: ${{ steps.read_config.outputs.perf_flag }}
perf_timeout: ${{ steps.read_config.outputs.perf_timeout }}
model_path: ${{ steps.read_config.outputs.model_path }}
perf_workspace: ${{ steps.read_config.outputs.perf_workspace }}
runner_label: ${{ steps.read_config.outputs.runner_label }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: read_config
id: read_config
env:
MIGRAPHX_MODEL_PATH_DEFAULT: ${{ env.MIGRAPHX_MODEL_PATH_DEFAULT }}
MIGRAPHX_PERF_WORKSPACE_DEFAULT: ${{ env.MIGRAPHX_PERF_WORKSPACE_DEFAULT }}
MIGRAPHX_RUNNER_LABEL_DEFAULT: ${{ env.MIGRAPHX_RUNNER_LABEL }}
run: |
ROCM_VERSION=$(grep 'ROCM_VERSION' .github/workflows/config.md | cut -d "'" -f2)
BENCHMARK_UTILS_REPO=$(grep 'BENCHMARK_UTILS_REPO' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_REPORTS_REPO=$(grep 'PERFORMANCE_REPORTS_REPO' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_BACKUP_REPO=$(grep 'PERFORMANCE_BACKUP_REPO' .github/workflows/config.md | cut -d "'" -f2)
ORGANIZATION_REPO=$(grep 'ORGANIZATION_REPO' .github/workflows/config.md | cut -d "'" -f2)
RESULTS_TO_COMPARE=$(grep 'RESULTS_TO_COMPARE' .github/workflows/config.md | cut -d "'" -f2)
CALCULATION_METHOD_FLAG=$(grep 'CALCULATION_METHOD_FLAG' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_TEST_TIMEOUT=$(grep 'PERFORMANCE_TEST_TIMEOUT' .github/workflows/config.md | cut -d "'" -f2)
MODEL_PATH=""
PERF_WS=""
if grep -q 'MIGRAPHX_MODEL_PATH' .github/workflows/config.md 2>/dev/null; then
MODEL_PATH=$(grep 'MIGRAPHX_MODEL_PATH' .github/workflows/config.md | cut -d "'" -f2)
fi
if grep -q 'MIGRAPHX_PERF_WORKSPACE' .github/workflows/config.md 2>/dev/null; then
PERF_WS=$(grep 'MIGRAPHX_PERF_WORKSPACE' .github/workflows/config.md | cut -d "'" -f2)
fi
RUNNER_LABEL=""
if grep -q 'MIGRAPHX_RUNNER_LABEL' .github/workflows/config.md 2>/dev/null; then
RUNNER_LABEL=$(grep 'MIGRAPHX_RUNNER_LABEL' .github/workflows/config.md | cut -d "'" -f2)
fi
MODEL_PATH="${MODEL_PATH:-$MIGRAPHX_MODEL_PATH_DEFAULT}"
PERF_WS="${PERF_WS:-$MIGRAPHX_PERF_WORKSPACE_DEFAULT}"
RUNNER_LABEL="${RUNNER_LABEL:-$MIGRAPHX_RUNNER_LABEL_DEFAULT}"
echo "rocm_version=$ROCM_VERSION"
echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT
echo "utils_repo=$BENCHMARK_UTILS_REPO" >> $GITHUB_OUTPUT
echo "reports_repo=$PERFORMANCE_REPORTS_REPO" >> $GITHUB_OUTPUT
echo "backup_repo=$PERFORMANCE_BACKUP_REPO" >> $GITHUB_OUTPUT
echo "repo_org=$ORGANIZATION_REPO" >> $GITHUB_OUTPUT
echo "perf_number=$RESULTS_TO_COMPARE" >> $GITHUB_OUTPUT
echo "perf_flag=$CALCULATION_METHOD_FLAG" >> $GITHUB_OUTPUT
echo "perf_timeout=$PERFORMANCE_TEST_TIMEOUT" >> $GITHUB_OUTPUT
echo "model_path=$MODEL_PATH" >> $GITHUB_OUTPUT
echo "perf_workspace=$PERF_WS" >> $GITHUB_OUTPUT
echo "runner_label=$RUNNER_LABEL" >> $GITHUB_OUTPUT
call_reusable:
needs: get_config
uses: ROCm/migraphx-benchmark/.github/workflows/perf-test.yml@testing
with:
rocm_release: ${{ github.event.inputs.rocm_release || needs.get_config.outputs.rocm_version }}
benchmark_utils_repo: ${{ github.event.inputs.benchmark_utils_repo || needs.get_config.outputs.utils_repo }}
performance_reports_repo: ${{ github.event.inputs.performance_reports_repo || needs.get_config.outputs.reports_repo }}
performance_backup_repo: ${{ github.event.inputs.performance_backup_repo || needs.get_config.outputs.backup_repo }}
organization: ${{ github.event.inputs.organization || needs.get_config.outputs.repo_org }}
result_number: ${{ github.event.inputs.result_number || needs.get_config.outputs.perf_number }}
flags: ${{ github.event.inputs.flags || needs.get_config.outputs.perf_flag }}
model_timeout: ${{ github.event.inputs.model_timeout || needs.get_config.outputs.perf_timeout }}
model_path: ${{ github.event.inputs.model_path || needs.get_config.outputs.model_path }}
perf_workspace: ${{ github.event.inputs.perf_workspace || needs.get_config.outputs.perf_workspace }}
runs_on: ${{ github.event.inputs.runner_label || needs.get_config.outputs.runner_label }}
secrets:
BENCHMARK_UTILS_READ_TOKEN: ${{ secrets.BENCHMARK_UTILS_READ_TOKEN }}