Repository navigation
153 lines (136 loc) · 5.29 KB
/
Copy pathtest-gpus.yml
File metadata and controls
153 lines (136 loc) · 5.29 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
name: GPU collectors
on:
workflow_dispatch:
schedule:
- cron: "0 */6 * * *" # every 6 hours
pull_request:
branches: [ main, dev ]
push:
branches: [main, dev]
permissions:
contents: read
jobs:
gpu-collectors:
permissions:
contents: read
checks: write
pull-requests: write
defaults:
run:
shell: bash --login {0}
runs-on: [self-hosted, instinct]
strategy:
matrix:
hardware: [mi210, mi300]
fail-fast: false
steps:
- name: Setup hardware-specific run details
run: |
if [ ${{ matrix.hardware }} == "mi210" ];then
echo "CI_QUEUE=devel" >> $GITHUB_ENV
elif [ ${{ matrix.hardware }} == "mi300" ];then
echo "CI_QUEUE=mi3001x" >> $GITHUB_ENV
else
echo "Unsupported hardware"
exit 1
fi
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Create virtual environment
run: |
python -m venv omnistat_venv
source omnistat_venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -r test/requirements.txt
pip install "nanobind<3.0"
cmake -S omnistat/rocprofiler-sdk/ -B build/
cmake --build build/
cmake --install build/ --prefix .
- name: Build kernel trace and counter libraries
run: |
cmake -B build -S omnistat/rocprofiler-sdk -DBUILD_KERNEL_TRACE_LIB=ON -DBUILD_COUNT_LIB=ON
cmake --build build
- name: Build test workloads
run: make -C test/workloads OFFLOAD_ARCH="gfx90a gfx942"
- name: Collector tests
env:
# Trailing colon is required: rocprofiler-sdk drops the last entry when
# parsing this variable, so the counter library would not be loaded.
ROCP_TOOL_LIBRARIES: "${{ github.workspace }}/build/libomnistat_trace.so:${{ github.workspace }}/build/libomnistat_count.so:"
run: |
source omnistat_venv/bin/activate
srun -N 1 -J omnistat -p $CI_QUEUE -t 00:10:00 \
pytest -v --require-rocmsmi --cov=omnistat --cov-report=xml --junitxml=results.xml test/test_collectors.py test/test_endpoint_collectors.py test/test_external_collector.py test/test_pm_counters.py test/test_rms.py test/test_unit_network.py test/test_unit_trace.py
## - name: Test Report
## uses: dorny/test-reporter@v2
## if: ${{ !cancelled() }}
## with:
## name: GPU Collectors
## reporter: jest-junit
## path: results.xml
# skip for dependabot (read-only token)
- name: Publish Test Report
uses: mikepenz/action-junit-report@8a133bfa3ecb0ea9024c1e2ae788b4c25f6cdb9d # v6.6.2
if: ${{ !cancelled() && github.actor != 'dependabot[bot]' }}
with:
include_passed: 'true'
report_paths: 'results.xml'
check_name: "Collector Tests (${{ matrix.hardware }})"
comment: 'true'
- name: Generate Coverage Summary
if: ${{ !cancelled() }}
run: |
source omnistat_venv/bin/activate
coverage report
TOTAL=$(coverage report --format=total)
echo "$TOTAL" > coverage-total.txt
echo "**Coverage (${{ matrix.hardware }}):** ${TOTAL}%" > coverage-summary.md
coverage report --fail-under=75 > /dev/null
# skip for dependabot (read-only token)
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5
if: github.event_name == 'pull_request' && !cancelled() && github.actor != 'dependabot[bot]'
with:
header: "coverage-${{ matrix.hardware }}"
path: coverage-summary.md
- name: Upload Coverage Data
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: ${{ !cancelled() }}
with:
name: coverage-${{ matrix.hardware }}
path: coverage-total.txt
coverage-badge:
permissions:
contents: write
needs: gpu-collectors
runs-on: ubuntu-latest
if: always() && !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout badges branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: badges
- name: Download coverage artifacts
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: coverage-*
merge-multiple: false
- name: Update coverage badge
run: |
MIN=$(cat coverage-*/coverage-total.txt | sort -n | head -1)
if [ $(echo "$MIN >= 75" | bc) -eq 1 ]; then
COLOR="green"
else
COLOR="red"
fi
cat > coverage.json <<EOF
{"schemaVersion":1,"label":"coverage","message":"${MIN}%","color":"${COLOR}"}
EOF
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add coverage.json
git diff --cached --quiet || git commit -m "update coverage: ${MIN}%"
git push