@@ -13,9 +13,9 @@ permissions:
1313 contents : write
1414
1515jobs :
16- build-ryzenai-server :
17- name : Build RyzenAI Server
18- runs-on : [rai-160 -sdk, Windows]
16+ build-and-test :
17+ name : Build and Test RyzenAI Server
18+ runs-on : [rai-170 -sdk, Windows]
1919 steps :
2020 - uses : actions/checkout@v4
2121 with :
7575 mkdir build
7676 cd build
7777
78- # Configure - Ryzen AI should be at C:\Program Files\RyzenAI\1.6 .0
78+ # Configure - Ryzen AI should be at C:\Program Files\RyzenAI\1.7 .0
7979 cmake .. -G "Visual Studio 17 2022" -A x64
8080 if ($LASTEXITCODE -ne 0) {
8181 Write-Host "ERROR: CMake configuration failed!" -ForegroundColor Red
@@ -119,37 +119,6 @@ jobs:
119119
120120 $fileCount = (Get-ChildItem $releaseDir -File | Measure-Object).Count
121121 Write-Host "`nFound $fileCount files in release directory" -ForegroundColor Green
122- Write-Host "Contents will be uploaded as artifact (GitHub will zip automatically)" -ForegroundColor Gray
123-
124- - name : Upload RyzenAI Server Package
125- uses : actions/upload-artifact@v4
126- with :
127- name : ryzenai-server
128- path : |
129- build/bin/Release/*.exe
130- build/bin/Release/*.dll
131- build/bin/Release/*.pdb
132- build/bin/Release/AMD_LICENSE
133- retention-days : 7
134-
135- test-ryzenai-server :
136- name : Test RyzenAI Server
137- needs : build-ryzenai-server
138- runs-on : [rai300_400, Windows]
139- strategy :
140- fail-fast : false
141- matrix :
142- mode : [cpu, npu, hybrid]
143- steps :
144- - uses : actions/checkout@v4
145- with :
146- clean : true
147-
148- - name : Download RyzenAI Server artifact
149- uses : actions/download-artifact@v4
150- with :
151- name : ryzenai-server
152- path : build/bin/Release
153122
154123 - name : Set up Python
155124 uses : actions/setup-python@v5
@@ -164,92 +133,106 @@ jobs:
164133 python -m pip install -r test/requirements.txt
165134 Write-Host "Test dependencies installed!" -ForegroundColor Green
166135
167- - name : Download model checkpoint
136+ - name : Test all modes
168137 shell : PowerShell
169138 run : |
170139 $ErrorActionPreference = "Stop"
171140
172141 # Set HF_HOME to local directory
173142 $env:HF_HOME = "${{ github.workspace }}/hf_home"
174- Write-Host "HF_HOME set to: $env:HF_HOME" -ForegroundColor Cyan
175143
176- # Create directory if it doesn't exist
177144 if (-not (Test-Path $env:HF_HOME)) {
178145 New-Item -ItemType Directory -Path $env:HF_HOME -Force | Out-Null
179146 }
180147
181148 # Model mapping based on mode
182149 $modelMap = @{
183- "npu" = "amd/Qwen2.5-3B -Instruct-onnx-ryzenai-npu"
184- "hybrid" = "amd/Qwen2.5-3B -Instruct-onnx-ryzenai-hybrid"
150+ "npu" = "amd/Llama-3.2-1B -Instruct-onnx-ryzenai-npu"
151+ "hybrid" = "amd/Qwen2.5-0.5B -Instruct-onnx-ryzenai-1.7 -hybrid"
185152 "cpu" = "amd/Qwen2.5-0.5B-Instruct-quantized_int4-float16-cpu-onnx"
186153 }
187154
188- $mode = "${{ matrix.mode }}"
189- $modelName = $modelMap[$mode]
190-
191- Write-Host "Downloading model for $mode mode: $modelName" -ForegroundColor Cyan
155+ $modes = @("cpu", "npu", "hybrid")
156+ $failed = @()
192157
193- # Download the model using huggingface_hub
194- python -c @"
158+ foreach ($mode in $modes) {
159+ $modelName = $modelMap[$mode]
160+ $logDir = "${{ github.workspace }}/test_logs"
161+
162+ Write-Host "`n============================================================" -ForegroundColor Cyan
163+ Write-Host " Testing mode: $mode ($modelName)" -ForegroundColor Cyan
164+ Write-Host "============================================================`n" -ForegroundColor Cyan
165+
166+ # Download the model
167+ Write-Host "Downloading model..." -ForegroundColor Cyan
168+ python -c @"
195169 import os
196170 os.environ['HF_HOME'] = r'${{ github.workspace }}/hf_home'
197-
198171 from huggingface_hub import snapshot_download
199-
200172 model_name = '$modelName'
201173 print(f'Downloading {model_name}...')
202-
203- local_path = snapshot_download(
204- repo_id=model_name,
205- local_dir=None, # Use default HF cache
206- )
207-
174+ local_path = snapshot_download(repo_id=model_name, local_dir=None)
208175 print(f'Model downloaded to: {local_path}')
209176 "@
210-
211- if ($LASTEXITCODE -ne 0) {
212- Write-Host "ERROR: Failed to download model!" -ForegroundColor Red
213- exit $LASTEXITCODE
177+
178+ if ($LASTEXITCODE -ne 0) {
179+ Write-Host "ERROR: Failed to download model for $mode!" -ForegroundColor Red
180+ $failed += $mode
181+ continue
182+ }
183+
184+ # Run tests
185+ Write-Host "Running tests for $mode..." -ForegroundColor Cyan
186+ python test/test_server.py --mode $mode --server-exe build/bin/Release/ryzenai-server.exe --log-dir $logDir
187+
188+ if ($LASTEXITCODE -ne 0) {
189+ Write-Host "ERROR: Tests failed for mode $mode!" -ForegroundColor Red
190+ $failed += $mode
191+ } else {
192+ Write-Host "All tests passed for mode: $mode" -ForegroundColor Green
193+ }
214194 }
215195
216- Write-Host "Model download complete!" -ForegroundColor Green
217-
218- - name : Run verification tests
219- shell : PowerShell
220- run : |
221- $ErrorActionPreference = "Stop"
222-
223- # Set HF_HOME
224- $env:HF_HOME = "${{ github.workspace }}/hf_home"
225-
226- $mode = "${{ matrix.mode }}"
227- $logDir = "${{ github.workspace }}/test_logs"
228-
229- Write-Host "Running verification tests for mode: $mode" -ForegroundColor Cyan
230- Write-Host "Log directory: $logDir" -ForegroundColor Gray
231-
232- # Run the test script with log directory
233- python test/test_server.py --mode $mode --server-exe build/bin/Release/ryzenai-server.exe --log-dir $logDir
234-
235- if ($LASTEXITCODE -ne 0) {
236- Write-Host "ERROR: Tests failed for mode $mode!" -ForegroundColor Red
237- exit $LASTEXITCODE
196+ # Summary
197+ Write-Host "`n============================================================" -ForegroundColor Cyan
198+ Write-Host " Test Summary" -ForegroundColor Cyan
199+ Write-Host "============================================================" -ForegroundColor Cyan
200+ foreach ($mode in $modes) {
201+ if ($failed -contains $mode) {
202+ Write-Host " $mode : FAILED" -ForegroundColor Red
203+ } else {
204+ Write-Host " $mode : PASSED" -ForegroundColor Green
205+ }
238206 }
207+ Write-Host "============================================================`n" -ForegroundColor Cyan
239208
240- Write-Host "All tests passed for mode: $mode" -ForegroundColor Green
209+ if ($failed.Count -gt 0) {
210+ Write-Host "ERROR: $($failed.Count) mode(s) failed: $($failed -join ', ')" -ForegroundColor Red
211+ exit 1
212+ }
241213
242214 - name : Upload server logs on failure
243215 if : failure()
244216 uses : actions/upload-artifact@v4
245217 with :
246- name : server-logs-${{ matrix.mode }}
218+ name : server-logs
247219 path : ${{ github.workspace }}/test_logs/
248220 retention-days : 7
249221
222+ - name : Upload RyzenAI Server Package
223+ uses : actions/upload-artifact@v4
224+ with :
225+ name : ryzenai-server
226+ path : |
227+ build/bin/Release/*.exe
228+ build/bin/Release/*.dll
229+ build/bin/Release/*.pdb
230+ build/bin/Release/AMD_LICENSE
231+ retention-days : 7
232+
250233 create-release :
251234 name : Create GitHub Release
252- needs : [ build-ryzenai-server, test-ryzenai-server]
235+ needs : build-and- test
253236 runs-on : ubuntu-latest
254237 if : startsWith(github.ref, 'refs/tags/v')
255238 steps :
@@ -295,12 +278,12 @@ jobs:
295278
296279 - Windows 11 (64-bit)
297280 - AMD Ryzen AI 300-series processor
298- - Ryzen AI Software 1.6.0 with LLM patch
281+ - Ryzen AI Software 1.7.0
299282
300283 ### Usage
301284
302285 ```cmd
303- ryzenai-server.exe -m C:\path\to\onnx\model --mode hybrid
286+ ryzenai-server.exe -m C:\path\to\onnx\model
304287 ```
305288
306289 See the [README](https://github.com/lemonade-sdk/ryzenai-server#readme) for full documentation.
0 commit comments