Preserve CUDA internal-test builds without the Windows CMake cycle - #32805
Xavier Dupré (xadupre) wants to merge 20 commits into
Conversation
Keep the module-to-host link dependency on Windows and remove the reverse build-order edge from the provider test executable. Document the module target as the targeted Windows internal-test build entry point. Fixes #32804 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Guard the shared dependency-list append at its source instead of filtering the provider-test copy later. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused dependency adjustment resolves the reported cycle without altering non-Windows or plugin configurations.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes the Windows CUDA internal-test CMake dependency cycle while preserving module linking and default-build behavior.
Changes:
- Removes the Windows-only executable-to-module dependency.
- Documents targeted Windows internal-test builds.
| File | Description |
|---|---|
cmake/onnxruntime_unittests.cmake |
Breaks the cyclic target dependency on Windows. |
docs/contrib_ops/cuda/matmul_nbits.md |
Documents the required module build target. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Build the dynamically loaded module explicitly for targeted builds instead of making it a prerequisite of the test executable. Retain the Windows module-to-executable import-library link. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate runtime module prerequisites from binary build dependencies. In the Windows non-plugin internal-test configuration, keep onnxruntime_provider_test as the public aggregate target and link the module against a separate executable target with the original output filename. Preserve CTest names, environment, timeout, reporting and executable PCH settings. Other configurations retain their executable target and module build dependency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evaluate the internal-test option after its prerequisites. Reject a missing test module in the Windows build job and explicitly run the wrapper on the GPU runner, requiring a fresh completed-test XML result so absent or skipped tests cannot pass silently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate configure from the full build and first build only the public provider-test target. Require fresh executable and CUDA test module outputs so the full build cannot mask a missing aggregate dependency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve size_t workspace sizes, use a float comparison literal, and widen the tactic-pruning threshold multiplication so the FLT_MAX no-best sentinel cannot overflow during constant folding. Keep warnings-as-errors enabled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Review of head Critical — Windows CUDA internal-test module fails to link ( Non-blocking question: The new XML check proves that the outer No other confirmed defects from the full review. This was a static review with PR-head CI-log verification; no local Windows build or GPU run was performed. |
Checkpoint the current incomplete fix. Automatic exports do not cover linked static-library symbols, and the test-count check runs before Google Test selects tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Compile internal-test objects before the host link and derive targeted exports from module references and static host libraries. Keep tests in the DLL, add export-generation regressions and CI artifact checks, and verify successful internal tests after execution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Emit a generated source containing /INCLUDE linker directives for the selected exports. This ensures MSVC extracts the required static-library members even when the host itself does not reference them, without exporting or forcing inclusion of unrelated symbols. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match CMake's DEF writer by emitting decorated symbol names directly. Add native linker library diagnostics and dump the generated DEF and EXP symbol table on fixture failure so export-name mismatches can be distinguished from archive resolution failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep tests in the module and call provider Node/Tensor implementations through statically linked opaque-pointer test adapters. Initialize the module's C++ API consistently, import host test utilities instead of duplicating ort_env-dependent objects, and link Windows ONNX protobuf definitions directly. Collect exports from actual host link inputs, including imported and object libraries. Extend the MSVC fixture to exercise class/struct adapters, separate API initialization modes, DLL loading, and incremental exports. Validation: rebuilt the actual Linux CUDA test module and passed all 126 selected tests with no skips. Generator regressions and Windows COFF linking passed locally; full native Windows validation remains for CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Review of updated head Minor failure-path finding — guard failed temporary-file creation in the CUDA module tests. The revised I would hold approval until that narrow failure path is addressed; the full-team review found no other confirmed blocking defects. I did not run a local Windows build or GPU test. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Account for the sparse initializer validation added on main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Copilot resolve the merge conflicts in this pull request |
…rnal-tests-cycle # Conflicts: # .github/workflows/android.yml Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Merged |
Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Replace the stale routing record reference in the packed INT GEMV path and preserve expert selection collection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the executable target for WebGPU definitions and cover packed INT GEMV expert counting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Fixes #32804.
Break the Windows CUDA internal-test dependency cycle while preserving
--target onnxruntime_provider_test: an aggregate target builds the executable and its dynamically loaded test module. Binary and CTest names remain unchanged.CUDA_EP_Unittest.Allon the GPU runner and reject missing or skipped tests.Local checks: CMake generation, PowerShell fixtures and lint; no ORT compilation. Windows CI has passed generation and built the host executable; module linking and execution remain to be validated.