forked from ROCm/rocm-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
224 lines (193 loc) · 7.54 KB
/
Copy pathhipdnn-superbuild-ci.yml
File metadata and controls
224 lines (193 loc) · 7.54 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT
#
# Lightweight CI for hipDNN + providers using the rocm-libraries superbuild
# and pre-built ROCm wheels (no TheRock source build required).
name: hipDNN Superbuild CI
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'projects/hipdnn/**'
- 'dnn-providers/**'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
hipdnn-windows-superbuild:
name: HipDNN Windows Superbuild
runs-on: azure-windows-scale-rocm
defaults:
run:
shell: bash
env:
BUILD_DIR: B:\build
VENV_PATH: B:\rocm_wheels
GPU_TARGET: gfx1151
steps:
- name: Runner health status
shell: pwsh
run: |
Write-Host "=== OS ==="
(Get-CimInstance Win32_OperatingSystem).Caption
Write-Host "=== CPU ==="
$cpu = Get-CimInstance Win32_Processor
Write-Host "$($cpu.Name) ($($cpu.NumberOfLogicalProcessors) logical cores)"
Write-Host "=== Memory ==="
$os = Get-CimInstance Win32_OperatingSystem
$totalGB = [math]::Round($os.TotalVisibleMemorySize / 1MB, 1)
$freeGB = [math]::Round($os.FreePhysicalMemory / 1MB, 1)
Write-Host "Total: ${totalGB} GB Free: ${freeGB} GB"
Write-Host "=== Disk ==="
Get-PSDrive -PSProvider FileSystem |
Select-Object Name,
@{N='Used(GB)';E={[math]::Round($_.Used/1GB,1)}},
@{N='Free(GB)';E={[math]::Round($_.Free/1GB,1)}},
Root |
Format-Table -AutoSize | Out-String | Write-Host
- name: Configure git longpaths
run: git config --global core.longpaths true
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
.dvc
.github
cmake
dnn-providers
projects/hipdnn
projects/miopen
test
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: Install build tools
run: |
choco source disable -n=chocolatey
choco source add -n=internal -s http://10.0.167.96:8081/repository/choco-group/ --priority=1
choco install --no-progress -y ccache
choco install --no-progress -y ninja --version 1.12.1
- name: Install ROCm wheels
shell: pwsh
run: |
Write-Host "Creating Python virtual environment at $env:VENV_PATH"
python -m venv $env:VENV_PATH
& "$env:VENV_PATH\Scripts\Activate.ps1"
Write-Host "Installing ROCm wheels from nightlies (target: $env:GPU_TARGET)"
pip install --index-url "https://rocm.nightlies.amd.com/v2/$env:GPU_TARGET/" "rocm[libraries,devel]"
if ($LASTEXITCODE -ne 0) { throw "Failed to install ROCm wheels" }
Write-Host "Initializing ROCm SDK"
rocm-sdk init
if ($LASTEXITCODE -ne 0) { throw "Failed to initialize ROCm SDK" }
$RocmSdkPath = "$env:VENV_PATH\Lib\site-packages\_rocm_sdk_devel" -replace '\\', '/'
Write-Host "ROCM_SDK_PATH=$RocmSdkPath"
echo "ROCM_SDK_PATH=$RocmSdkPath" >> $env:GITHUB_ENV
- name: Configure superbuild
run: |
cmake --preset hipdnn-providers-all -GNinja \
-DROCM_PATH="$ROCM_SDK_PATH" \
-DCMAKE_PROGRAM_PATH="$ROCM_SDK_PATH/lib/llvm/bin" \
-DGPU_TARGETS="$GPU_TARGET" \
-DROCM_LIBS_ENABLE_ROOT_CTEST=ON \
-DENABLE_CLANG_FORMAT=OFF \
-DENABLE_CLANG_TIDY=OFF
- name: Build
run: cmake --build build
# Windows tests have a few issues where we are loading plugins and thats causing issues with super build tests
# as they end up trying to init a gpu on a non gpu machine. This work is ticketed to be fixed later.
#- name: Add ROCm bin to PATH
# run: echo "$ROCM_SDK_PATH/bin" >> "$GITHUB_PATH"
#- name: Run tests
# run: ctest --test-dir build --output-on-failure
hipdnn-linux-superbuild:
name: HipDNN Linux Superbuild
runs-on: azure-linux-scale-rocm
env:
GPU_TARGET: gfx94X-dcgpu
steps:
- name: Runner health status
run: |
echo "=== OS ==="
cat /etc/os-release | head -2
echo "=== CPU ==="
lscpu | grep -E 'Model name|^CPU\(s\)'
echo "=== Memory ==="
free -h | grep Mem
echo "=== Disk ==="
df -h /
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
.dvc
.github
cmake
dnn-providers
projects/hipdnn
projects/miopen
test
- name: Set environment
run: echo "VENV_PATH=${{ runner.temp }}/rocm_wheels" >> "$GITHUB_ENV"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache lsb-release wget software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
sudo apt-get install -y clang-tidy-20 clang-tools-20
- name: Install ROCm wheels
run: |
echo "Creating Python virtual environment at $VENV_PATH"
python -m venv "$VENV_PATH"
source "$VENV_PATH/bin/activate"
echo "Installing ROCm wheels from nightlies (target: $GPU_TARGET)"
pip install --index-url "https://rocm.nightlies.amd.com/v2/$GPU_TARGET/" "rocm[libraries,devel]"
echo "Initializing ROCm SDK"
rocm-sdk init
SITE_PACKAGES=$("$VENV_PATH/bin/python" -c "import site; print(site.getsitepackages()[0])")
ROCM_SDK_PATH="$SITE_PACKAGES/_rocm_sdk_devel"
echo "ROCM_SDK_PATH=$ROCM_SDK_PATH"
echo "ROCM_SDK_PATH=$ROCM_SDK_PATH" >> "$GITHUB_ENV"
- name: Configure superbuild
run: |
cmake --preset hipdnn-providers-all -GNinja \
-DROCM_PATH="$ROCM_SDK_PATH" \
-DCMAKE_PROGRAM_PATH="$ROCM_SDK_PATH/lib/llvm/bin" \
-DGPU_TARGETS="$GPU_TARGET" \
-DROCM_LIBS_ENABLE_ROOT_CTEST=ON \
-DENABLE_CLANG_FORMAT=OFF \
-DENABLE_CLANG_TIDY=ON \
-DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-20
- name: Build
run: cmake --build build
- name: Run tests
run: ctest --test-dir build --output-on-failure
hipdnn_build_summary:
name: hipDNN Superbuild Summary
if: always()
needs:
- hipdnn-windows-superbuild
- hipdnn-linux-superbuild
runs-on: ubuntu-24.04
steps:
- name: Report results
run: |
echo '${{ toJson(needs) }}'
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
| jq --raw-output \
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
)"
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "Failed jobs: ${FAILED_JOBS}"
exit 1
fi