Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
da53553
Fix Windows CUDA internal-test target dependency cycle
xadupre Sep 25, 2026
ae177b5
Avoid adding the Windows CUDA test back dependency
xadupre Sep 25, 2026
c7970cf
Remove the CUDA test module build prerequisite on all platforms
xadupre Sep 25, 2026
64dccfb
Preserve CUDA internal-test builds with a Windows aggregate target
xadupre Sep 25, 2026
82428e1
Require Windows CI to build and execute CUDA internal tests
xadupre Sep 25, 2026
bae016a
Verify targeted provider-test builds before the full Windows build
xadupre Sep 25, 2026
e4d41c8
Fix MSVC warnings exposed by CUDA internal-test builds
xadupre Sep 25, 2026
5b6b3ea
WIP: export Windows provider-test symbols and check internal test count
xadupre Sep 28, 2026
236645d
Limit Windows CUDA test host exports to required symbols
xadupre Sep 28, 2026
664e0f3
Fix CUDA test export helper include path
xadupre Sep 28, 2026
af229d1
Force inclusion of selected Windows test host exports
xadupre Sep 28, 2026
6f6c9d5
Emit unquoted COFF names in Windows test exports
xadupre Sep 28, 2026
263ce0e
Fix CUDA internal-test host/provider boundaries
xadupre Sep 28, 2026
d57c3d4
Guard CUDA test temporary files
xadupre Sep 29, 2026
7a37727
Raise Android minimal binary size threshold
xadupre Sep 29, 2026
0df744e
Merge remote-tracking branch 'origin/main' into fix/windows-cuda-inte…
Copilot Sep 29, 2026
3dfc0ce
Limit Windows ARM64 workflow token permissions
Copilot Sep 29, 2026
a27bfdd
Fix QMoE routing snapshot build
xadupre Sep 29, 2026
d978b23
Address provider target review feedback
xadupre Sep 29, 2026
347b088
Fix packed INT GEMV counting test shape
xadupre Sep 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
run: |
set -e -x
BINARY_SIZE_THRESHOLD_ARGS=""
echo "Binary size threshold in bytes: 1597440"
BINARY_SIZE_THRESHOLD_ARGS="--threshold_size_in_bytes 1597440"
echo "Binary size threshold in bytes: 1599488"
BINARY_SIZE_THRESHOLD_ARGS="--threshold_size_in_bytes 1599488"

# Ensure ANDROID_NDK_HOME is available and get its real path
if [ -z "$ANDROID_NDK_HOME" ]; then
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows_arm64_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- rel-*
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: true
Expand Down
62 changes: 59 additions & 3 deletions .github/workflows/windows_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,53 @@ jobs:
$buildDir = Join-Path ${{ runner.temp }} "build"
echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV

- name: Build and Clean Binaries
- name: Configure build
working-directory: ${{ runner.temp }}
run: |
npm install -g typescript
if ($lastExitCode -ne 0) {
exit $lastExitCode
}
# Execute the build process
python.exe ${{ github.workspace }}\tools\ci_build\build.py --update --build --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --nvcc_threads 4 --flash_nvcc_threads 4 --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.8" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines onnxruntime_QUICK_BUILD=ON --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
python.exe ${{ github.workspace }}\tools\ci_build\build.py --update --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --nvcc_threads 4 --flash_nvcc_threads 4 --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.8" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines onnxruntime_QUICK_BUILD=ON --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
if ($lastExitCode -ne 0) {
exit $lastExitCode
}
shell: pwsh

- name: Verify targeted provider-test build
shell: pwsh
run: |
python.exe ${{ github.workspace }}\tools\ci_build\test_gen_test_exports.py
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

$buildDir = Join-Path $env:OnnxRuntimeBuildDirectory "RelWithDebInfo"
$binaryDir = Join-Path $buildDir "RelWithDebInfo"
$testBinaries = @("onnxruntime_provider_test.exe", "onnxruntime_provider_test.lib", "onnxruntime_providers_cuda_ut.dll")
foreach ($binary in $testBinaries) {
$path = Join-Path $binaryDir $binary
if (Test-Path -LiteralPath $path) {
throw "The targeted-build check requires fresh outputs, but $path already exists."
}
}

cmake --build "$buildDir" --config RelWithDebInfo --target onnxruntime_provider_test --parallel
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

foreach ($binary in $testBinaries) {
$path = Join-Path $binaryDir $binary
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) {
throw "Building only onnxruntime_provider_test did not produce $path"
}
}

- name: Build and Clean Binaries
working-directory: ${{ runner.temp }}
run: |
python.exe ${{ github.workspace }}\tools\ci_build\build.py --build --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --nvcc_threads 4 --flash_nvcc_threads 4 --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.8" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines onnxruntime_QUICK_BUILD=ON --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
if ($lastExitCode -ne 0) {
exit $lastExitCode
}
Expand Down Expand Up @@ -230,6 +268,24 @@ jobs:
shell: pwsh
run: nvidia-smi

- name: Verify CUDA EP internal tests execute
working-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo
shell: pwsh
run: |
if (Test-Path -LiteralPath cuda_ep_internal_ci.xml) {
Remove-Item -LiteralPath cuda_ep_internal_ci.xml
}
.\onnxruntime_provider_test.exe --gtest_filter=CUDA_EP_Unittest.All --gtest_output=xml:cuda_ep_internal_ci.xml
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

[xml]$results = Get-Content -LiteralPath cuda_ep_internal_ci.xml -Raw
$executedTest = $results.SelectNodes("/testsuites/testsuite[@name='CUDA_EP_Unittest']/testcase[@name='All' and @status='run' and @result='completed']")
if ($executedTest.Count -ne 1) {
throw "CUDA_EP_Unittest.All did not execute: the test must be present and must not be skipped."
}

- name: Run Tests
working-directory: ${{ runner.temp }}
run: |
Expand Down
11 changes: 6 additions & 5 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ option(onnxruntime_ENABLE_PYTHON "Enable python bindings" OFF)
option(onnxruntime_ENABLE_MEMLEAK_CHECKER "Experimental: Enable memory leak checker in Windows debug build" OFF)
option(onnxruntime_ENABLE_CONVSYMKERNELAVX2_SAT_CHECKER "Experimental: Enable ConvSymKernelAvx2 assembly saturation checker in build" OFF)
option(onnxruntime_USE_CUDA "Build with CUDA support" OFF)
# Enable ONNX Runtime CUDA EP's internal unit tests that directly access the EP's internal functions instead of through
# OpKernels. When the option is ON, we will have two copies of GTest library in the same process. It is not a typical
# use. If you hit any problem with that, please do not report it to GTest. Turn OFF the following build option instead.
cmake_dependent_option(onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS "Build with CUDA unit tests" OFF "onnxruntime_USE_CUDA;onnxruntime_BUILD_UNIT_TESTS" OFF)

cmake_dependent_option(onnxruntime_USE_CUDA_NHWC_OPS "Build CUDA with NHWC op support" ON "onnxruntime_USE_CUDA" OFF)
cmake_dependent_option(onnxruntime_BUILD_CUDA_EP_AS_PLUGIN "Build CUDA EP as a separate plugin shared library instead of the legacy in-tree provider" OFF "onnxruntime_USE_CUDA" OFF)
option(onnxruntime_BUILD_CUDA_QUANT_PREPROCESS "Build CUDA weight-packing module onnxruntime_cuda_quant_preprocess.so" OFF)
Expand All @@ -97,6 +92,12 @@ option(onnxruntime_USE_ARM_NEON_NCHWC "Build with ARM Neon NCHWc kernels in MLAS
option(onnxruntime_USE_KLEIDIAI "Build with KleidiAI integration in MLAS" OFF)
option(onnxruntime_USE_QMX_KLEIDIAI_COEXIST "Build with QMX and Arm KLEIDIAI libraries" OFF)
option(onnxruntime_BUILD_UNIT_TESTS "Build ONNXRuntime unit tests" ON)
# Declare both prerequisites before evaluating this dependent option on a fresh configure.
# Enable ONNX Runtime CUDA EP's internal unit tests that directly access the EP's internal functions instead of through
# OpKernels. When the option is ON, we will have two copies of GTest library in the same process. It is not a typical
# use. If you hit any problem with that, please do not report it to GTest. Turn OFF the following build option instead.
cmake_dependent_option(onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS "Build with CUDA unit tests" OFF "onnxruntime_USE_CUDA;onnxruntime_BUILD_UNIT_TESTS" OFF)

# Materialize the ONNX node-test corpus from ONNX's Python generators into the build tree at
# configure/build time, instead of depending on the on-disk corpus shipped in the ONNX source
# archive. This detaches ORT from ONNX PR #7959 (which deletes onnx/backend/test/data/node).
Expand Down
57 changes: 57 additions & 0 deletions cmake/onnxruntime_test_exports.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

function(onnxruntime_export_test_symbols host)
cmake_parse_arguments(EXPORTS "" "OBJECT_TARGET" "HOST_LIBS;MODULE_LIBS" ${ARGN})
find_package(Python COMPONENTS Interpreter REQUIRED)

set(module_files $<TARGET_OBJECTS:${EXPORTS_OBJECT_TARGET}>)
set(host_files)
set(library_dependencies)
foreach(side HOST MODULE)
foreach(library IN LISTS EXPORTS_${side}_LIBS)
if(TARGET ${library})
get_target_property(library_type ${library} TYPE)
if(library_type STREQUAL "STATIC_LIBRARY" OR library_type STREQUAL "UNKNOWN_LIBRARY")
set(library_files $<TARGET_FILE:${library}>)
elseif(library_type STREQUAL "OBJECT_LIBRARY")
set(library_files $<TARGET_OBJECTS:${library}>)
else()
continue()
endif()
if(side STREQUAL "HOST")
list(APPEND host_files ${library_files})
else()
list(APPEND module_files ${library_files})
endif()
list(APPEND library_dependencies ${library})
endif()
endforeach()
endforeach()
if(NOT host_files)
message(FATAL_ERROR "No static host libraries found for ${host}'s test exports")
endif()
list(REMOVE_DUPLICATES host_files)
list(REMOVE_DUPLICATES module_files)
list(REMOVE_DUPLICATES library_dependencies)

set(export_dir "${CMAKE_CURRENT_BINARY_DIR}/${host}_exports/$<CONFIG>")
file(GENERATE OUTPUT "${export_dir}/host.rsp" CONTENT "\"$<JOIN:${host_files},\"\n\">\"\n")
file(GENERATE OUTPUT "${export_dir}/module.rsp" CONTENT "\"$<JOIN:${module_files},\"\n\">\"\n")
set(export_script "${REPO_ROOT}/tools/ci_build/gen_test_exports.py")
set(export_file "${export_dir}/exports.def")
set(force_include_file "${export_dir}/force_include.cc")
add_custom_command(OUTPUT "${export_file}" "${force_include_file}"
COMMAND ${Python_EXECUTABLE} "${export_script}"
--linker "${CMAKE_LINKER}"
--host "${export_dir}/host.rsp"
--module "${export_dir}/module.rsp"
--output "${export_file}"
--force-include "${force_include_file}"
DEPENDS "${export_script}" "${export_dir}/host.rsp" "${export_dir}/module.rsp"
${EXPORTS_OBJECT_TARGET} ${library_dependencies} ${host_files} ${module_files}
VERBATIM)
set_target_properties(${host} PROPERTIES ENABLE_EXPORTS ON WINDOWS_EXPORT_ALL_SYMBOLS OFF)
set_source_files_properties("${force_include_file}" PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
target_sources(${host} PRIVATE "${export_file}" "${force_include_file}")
endfunction()
2 changes: 1 addition & 1 deletion cmake/onnxruntime_test_pch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
"${CMAKE_CURRENT_SOURCE_DIR}/test_pch.h"
)
if (TARGET onnxruntime_provider_test)
target_precompile_headers(onnxruntime_provider_test PRIVATE
target_precompile_headers(${onnxruntime_provider_test_target} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/test_pch.h"
)
endif()
Expand Down
Loading
Loading