@@ -15,14 +15,15 @@ concurrency:
1515 group : ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
1616 cancel-in-progress : true
1717
18+ # TODO: enable --build_nodejs
1819jobs :
19- build_x64_RelWithDebInfo :
20- name : Windows GPU CUDA CI Pipeline # Job name set here
21- runs-on : ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10 "]
20+ build :
21+ name : Windows GPU CUDA CI Pipeline
22+ runs-on : ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms "]
2223 steps :
2324 - uses : actions/checkout@v4
2425 with :
25- fetch-depth : 0 # Fetch all history for all tags and branches
26+ fetch-depth : 0
2627 submodules : ' none'
2728
2829 - uses : actions/setup-python@v5
@@ -96,40 +97,146 @@ jobs:
9697 run : nuget restore ${{ github.workspace }}\packages.config -ConfigFile ${{ github.workspace }}\NuGet.config -PackagesDirectory ${{ runner.temp }}\build\RelWithDebInfo
9798 shell : cmd
9899
99- - name : Export GitHub Actions cache environment variables
100- uses : actions/github-script@v7
101- with :
102- script : |
103- core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
104- core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
105-
106100 - name : Set OnnxRuntimeBuildDirectory
107101 shell : pwsh
108102 run : |
109103 $buildDir = Join-Path ${{ runner.temp }} "build"
110104 echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV
111105
112- - name : Build and Test
106+ - name : Build and Clean Binaries
113107 working-directory : ${{ runner.temp }}
114108 run : |
115- python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.2" --enable_cuda_profiling --enable_transformers_tool_test --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
109+ npm install -g typescript
110+ if ($lastExitCode -ne 0) {
111+ exit $lastExitCode
112+ }
113+ # Execute the build process
114+ python.exe ${{ github.workspace }}\tools\ci_build\build.py --update --build --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.2" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
116115 if ($lastExitCode -ne 0) {
117116 exit $lastExitCode
118117 }
119- Remove-Item "${{ runner.temp }}\build\RelWithDebInfo" -Include "*.obj" -Recurse
118+
119+ # Clean up the output directory before uploading artifacts
120+ $outputDir = "${{ runner.temp }}\build\RelWithDebInfo"
121+ Write-Host "Cleaning up files from $outputDir..."
122+
123+ Remove-Item -Path "$outputDir\onnxruntime" -Recurse -Force -ErrorAction SilentlyContinue
124+ Remove-Item -Path "$outputDir\pybind11" -Recurse -Force -ErrorAction SilentlyContinue
125+ Remove-Item -Path "$outputDir\models" -Recurse -Force -ErrorAction SilentlyContinue
126+ Remove-Item -Path "$outputDir\vcpkg_installed" -Recurse -Force -ErrorAction SilentlyContinue
127+ Remove-Item -Path "$outputDir\_deps" -Recurse -Force -ErrorAction SilentlyContinue
128+ Remove-Item -Path "$outputDir\CMakeCache.txt" -Force -ErrorAction SilentlyContinue
129+ Remove-Item -Path "$outputDir\CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue
130+ # Remove intermediate object files as in the original script
131+ Remove-Item -Path $outputDir -Include "*.obj" -Recurse
120132 shell : pwsh
121133
122- - name : Validate C# native delegates
123- run : python tools\ValidateNativeDelegateAttributes.py
124- working-directory : ${{ github.workspace }}\csharp
134+ - name : Upload build artifacts
135+ uses : actions/upload-artifact@v4
136+ with :
137+ name : build-artifacts
138+ path : ${{ runner.temp }}\build
139+ env :
140+ OrtPackageId : Microsoft.ML.OnnxRuntime.Gpu
141+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
142+ setVcvars : true
143+ ALLOW_RELEASED_ONNX_OPSET_ONLY : ' 0'
144+ DocUpdateNeeded : false
145+ ONNXRUNTIME_TEST_GPU_DEVICE_ID : ' 0'
146+ AZCOPY_AUTO_LOGIN_TYPE : MSI
147+ AZCOPY_MSI_CLIENT_ID : 63b63039-6328-442f-954b-5a64d124e5b4
148+
149+ test :
150+ name : Windows GPU CUDA CI Pipeline Test Job
151+ needs : build
152+ timeout-minutes : 300
153+ runs-on : ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"]
154+ steps :
155+ - uses : actions/checkout@v4
156+ with :
157+ fetch-depth : 0
158+ submodules : ' none'
159+
160+ - name : Download build artifacts
161+ uses : actions/download-artifact@v4
162+ with :
163+ name : build-artifacts
164+ path : ${{ runner.temp }}\build
165+
166+ - uses : actions/setup-python@v5
167+ with :
168+ python-version : ' 3.12'
169+ architecture : x64
170+
171+ - uses : actions/setup-node@v4
172+ with :
173+ node-version : ' 20.x'
174+
175+ - uses : actions/setup-java@v4
176+ with :
177+ distribution : ' temurin'
178+ java-version : ' 17'
179+ architecture : x64
180+
181+ - name : Locate vcvarsall and Setup Env
182+ uses : ./.github/actions/locate-vcvarsall-and-setup-env
183+ with :
184+ architecture : x64
185+
186+ - name : Install python modules
187+ run : python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt
188+ working-directory : ${{ github.workspace }}
125189 shell : cmd
126190
191+ - name : Download CUDA SDK v12.2
192+ working-directory : ${{ runner.temp }}
193+ run : |
194+ azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" .
195+ dir
196+ shell : pwsh
197+
198+ - name : Add CUDA to PATH
199+ shell : powershell
200+ run : |
201+ Write-Host "Adding CUDA to PATH"
202+ Write-Host "CUDA Path: $env:RUNNER_TEMP\v12.2\bin"
203+ Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\bin"
204+ Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\extras\CUPTI\lib64"
205+
206+ - name : Set OnnxRuntimeBuildDirectory
207+ shell : pwsh
208+ run : |
209+ $buildDir = Join-Path ${{ runner.temp }} "build"
210+ echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV
211+
127212 - name : Install ONNX Runtime Wheel
128213 uses : ./.github/actions/install-onnxruntime-wheel
129214 with :
130215 whl-directory : ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist
131216
132- timeout-minutes : 300
217+ - name : Run Tests
218+ working-directory : ${{ runner.temp }}
219+ run : |
220+ npm install -g typescript
221+ if ($lastExitCode -ne 0) {
222+ exit $lastExitCode
223+ }
224+
225+ python.exe ${{ github.workspace }}\tools\python\update_ctest_path.py "${{ runner.temp }}\build\RelWithDebInfo\CTestTestfile.cmake" "${{ runner.temp }}\build\RelWithDebInfo"
226+ if ($lastExitCode -ne 0) {
227+ exit $lastExitCode
228+ }
229+
230+ python.exe ${{ github.workspace }}\tools\ci_build\build.py --test --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.2" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
231+ if ($lastExitCode -ne 0) {
232+ exit $lastExitCode
233+ }
234+ shell : pwsh
235+
236+ - name : Validate C# native delegates
237+ run : python tools\ValidateNativeDelegateAttributes.py
238+ working-directory : ${{ github.workspace }}\csharp
239+ shell : cmd
133240 env :
134241 OrtPackageId : Microsoft.ML.OnnxRuntime.Gpu
135242 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
0 commit comments