Skip to content

Commit 11fd9e4

Browse files
bmehta001Copilot
andcommitted
sdk_v2: scrub vestigial WinML/non-WinML separation from comments, docs, backend
The flavor split is gone from sdk_v2 code, but stale references to it lingered in comments and docs. Reword them to describe the unified reality — WinML is always on on Windows, so the distinction is platform, not flavor: - cpp/CMakeLists.txt, cpp/test/CMakeLists.txt, js/script/copy-native.mjs: "no WinML SKU" / "WinML build" / "non-WinML build" -> platform wording. - cpp/cmake/FindOnnxRuntime.cmake: drop the now-vacuous "for both flavors". - .pipelines/v2: steps-build-windows.yml (Standard-vs-WinML build split -> one Windows build), steps-test-python.yml ("Both variants" -> per-job wheel), and the plan docs ("per variant"; deferred "WinML variant" bullet). - build_and_test_all.ps1: tighten the net9.0/net462 test comment. Also simplify python/_build_backend: with deps_versions_winml.json gone there is a single deps file, so drop the _STD suffix and the deps_file parameter threaded through _read_versions/_patch_pyproject_text. Verified it still rewrites all four ORT/GenAI pins from deps_versions.json. sdk_v2-only; the V1 sdk/ + .pipelines/v1 generation keeps its flavor split. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b42bd6b commit 11fd9e4

10 files changed

Lines changed: 36 additions & 42 deletions

File tree

.pipelines/v2/sdk_v2-js-pipeline-plan.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Out of scope (deferred):
1919

2020
- **Linux ARM64.** Cross-cutting ARM64 work item will add this for C++,
2121
C#, Python, and JS together.
22-
- **WinML variant.** JS is scoped out by the base plan.
2322
- **npm publishing.** Pipeline produces the `.tgz` as an artifact only.
2423

2524
## Supported platforms

.pipelines/v2/sdk_v2-pipeline-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ are gated separately via `.pipelines/v1/templates/stages-sdk-v1.yml`.
8181
at wheel-build time. If the backend is ever bypassed, `pip install`
8282
fails fast with "no matching version" (intentional loud failure).
8383

84-
Bumping ORT/GenAI is a one-file edit per variant.
84+
Bumping ORT/GenAI is a one-file edit.
8585
9. **ORT/GenAI come from public PyPI.** No private feed plumbing required
8686
for the wheel install path:
8787
- `onnxruntime-core` (Windows/macOS)

.pipelines/v2/templates/steps-build-windows.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,15 @@ steps:
115115
VCPKG_ROOT: $(Build.BinariesDirectory)\vcpkg
116116
FOUNDRY_TEST_DATA_DIR: $(Agent.BuildDirectory)\test-data-shared
117117

118-
# Stage the redistributable native artifacts.
119-
# - Standard build: vcpkg statically links ORT/GenAI/azure-*/spdlog/fmt/
120-
# libcurl/libssl/zlib/brotli* into foundry_local.dll (see
121-
# sdk_v2/cpp/triplets/x64-windows.cmake), so the only runtime payload is
122-
# foundry_local.dll itself.
123-
# - WinML build: foundry_local.dll picks up one extra runtime dependency,
124-
# Microsoft.Windows.AI.MachineLearning.dll, which must travel with the wheel.
125-
# The WinML DLL is delay-loaded (see /DELAYLOAD in CMakeLists.txt) so it is
126-
# NOT needed at foundry_local.dll load time, but the cmake post-build copy
127-
# stages it next to foundry_local.dll for runtime EP discovery. ORT/GenAI
128-
# come from the onnxruntime-core / onnxruntime-genai-core pip deps.
118+
# Stage the redistributable native artifacts. vcpkg statically links
119+
# ORT/GenAI/azure-*/spdlog/fmt/libcurl/libssl/zlib/brotli* into foundry_local.dll
120+
# (see sdk_v2/cpp/triplets/x64-windows.cmake), so foundry_local.dll carries that
121+
# payload itself. It also picks up one extra runtime dependency,
122+
# Microsoft.Windows.AI.MachineLearning.dll, which must travel with the wheel.
123+
# The WinML DLL is delay-loaded (see /DELAYLOAD in CMakeLists.txt) so it is
124+
# NOT needed at foundry_local.dll load time, but the cmake post-build copy
125+
# stages it next to foundry_local.dll for runtime EP discovery. ORT/GenAI
126+
# come from the onnxruntime-core / onnxruntime-genai-core pip deps.
129127
- task: PowerShell@2
130128
displayName: 'Stage native artifacts'
131129
inputs:

.pipelines/v2/templates/steps-test-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ steps:
5353
targetType: inline
5454
pwsh: true
5555
script: |
56-
# Locate the wheel. Both variants land in their own per-job artifact
57-
# so a single match is expected.
56+
# Locate the wheel. Each job's wheel lands in its own artifact, so a
57+
# single match is expected.
5858
$wheels = @(Get-ChildItem "${{ parameters.wheelDir }}" -Recurse -Filter '*.whl')
5959
if ($wheels.Count -eq 0) { throw "No .whl found under ${{ parameters.wheelDir }}" }
6060
if ($wheels.Count -gt 1) {

sdk_v2/build_and_test_all.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,8 @@ try {
137137
dotnet @buildArgs
138138
if ($LASTEXITCODE -ne 0) { throw "dotnet build exit $LASTEXITCODE" }
139139

140-
# The test csproj multi-targets net8.0/net9.0 (and net462 on Windows)
141-
# for build coverage; run the .NET (Core) test suite once on net9.0
142-
# (back-compat covers net8.0 consumers) plus net462 on Windows to
143-
# exercise the netstandard polyfills at runtime.
140+
# Test on net9.0 (back-compat covers net8.0 consumers); on Windows
141+
# also run net462 to exercise the netstandard2.0 polyfills.
144142
$frameworks = @('net9.0')
145143
if ($IsWindows) { $frameworks += 'net462' }
146144

sdk_v2/cpp/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ else()
111111
endif()
112112

113113
# WinML EP bootstrapper is only built when the WinML EP catalog package is
114-
# available — the source unconditionally references its headers/types. Other
115-
# Windows builds (no WinML SKU) skip it entirely; manager.cc gates the call
116-
# site on FOUNDRY_LOCAL_HAS_EP_CATALOG so DiscoverProviders is only invoked
117-
# when this translation unit is linked in.
114+
# available — the source unconditionally references its headers/types, which
115+
# exist only on Windows. manager.cc gates the call site on
116+
# FOUNDRY_LOCAL_HAS_EP_CATALOG so DiscoverProviders is only invoked when this
117+
# translation unit is linked in.
118118
if(WinMLEpCatalog_FOUND)
119119
list(APPEND FOUNDRY_LOCAL_PLATFORM_SOURCES
120120
src/ep_detection/winml_ep_bootstrapper.cc

sdk_v2/cpp/cmake/FindOnnxRuntime.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ else()
220220
set_target_properties(OnnxRuntime::OnnxRuntime PROPERTIES
221221
IMPORTED_IMPLIB "${_ORT_LIB_DIR}/onnxruntime.lib"
222222
)
223-
# On Windows, the runtime DLL sits next to the import lib for both flavors.
223+
# On Windows, the runtime DLL sits next to the import lib.
224224
if(NOT _ORT_DLL_DIR)
225225
set(_ORT_DLL_DIR "${_ORT_LIB_DIR}")
226226
endif()

sdk_v2/cpp/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ else()
105105
endif()
106106

107107
include(GoogleTest)
108-
# DISCOVERY_TIMEOUT defaults to 5s, which is not enough for the WinML build:
108+
# DISCOVERY_TIMEOUT defaults to 5s, which is not enough for the Windows build:
109109
# foundry_local.dll links against Microsoft.Windows.AI.MachineLearning.dll
110110
# (delay-loaded) plus standalone ORT, and process startup + gtest enumeration
111111
# can exceed 5s on cold caches or slow CI agents. Bump to 60s for headroom.

sdk_v2/js/script/copy-native.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ let copied = 0;
7878
const available = new Set(readdirSync(sourceDir));
7979
for (const file of wanted) {
8080
if (!available.has(file)) {
81-
// Skip optional deps that aren't present in this build flavor (e.g.
82-
// WinML bits in a non-WinML build).
81+
// Skip optional deps not produced on this platform (e.g. the Windows ML
82+
// runtime only exists in Windows builds).
8383
continue;
8484
}
8585
const src = resolve(sourceDir, file);

sdk_v2/python/_build_backend/__init__.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,32 @@
4343

4444

4545
_PYPROJECT = Path(__file__).resolve().parent.parent / "pyproject.toml"
46-
_SDK_V2_ROOT = _PYPROJECT.resolve().parent.parent
47-
_DEPS_JSON_STD = _SDK_V2_ROOT / "deps_versions.json"
46+
_DEPS_JSON = _PYPROJECT.parent.parent / "deps_versions.json"
4847

49-
# Patterns for rewriting ORT/GenAI version pins in the dependencies list.
50-
# Each captures the package name + ``==`` and we substitute in the version
51-
# read from the appropriate deps_versions JSON.
48+
# Patterns for rewriting ORT/GenAI version pins in the dependencies list. Each
49+
# captures the package name + ``==`` and we substitute in the version read from
50+
# deps_versions.json.
5251
_ORT_PIN_PATTERN = re.compile(r'("onnxruntime(?:-core|-gpu)==)[^\s";]+')
5352
_GENAI_PIN_PATTERN = re.compile(r'("onnxruntime-genai(?:-core|-cuda)==)[^\s";]+')
5453

5554

56-
def _read_versions(deps_file: Path) -> tuple[str, str]:
57-
if not deps_file.is_file():
58-
raise RuntimeError(f"Required versions file not found: {deps_file}")
59-
data = json.loads(deps_file.read_text(encoding="utf-8"))
55+
def _read_versions() -> tuple[str, str]:
56+
if not _DEPS_JSON.is_file():
57+
raise RuntimeError(f"Required versions file not found: {_DEPS_JSON}")
58+
data = json.loads(_DEPS_JSON.read_text(encoding="utf-8"))
6059
try:
6160
ort = data["onnxruntime"]["version"]
6261
genai = data["onnxruntime-genai"]["version"]
6362
except (KeyError, TypeError) as exc:
6463
raise RuntimeError(
65-
f"{deps_file} is missing required keys 'onnxruntime.version' / 'onnxruntime-genai.version'"
64+
f"{_DEPS_JSON} is missing required keys 'onnxruntime.version' / 'onnxruntime-genai.version'"
6665
) from exc
6766
return str(ort), str(genai)
6867

6968

70-
def _patch_pyproject_text(original: str, *, deps_file: Path) -> str:
71-
"""Return *original* with the ORT/GenAI version pins rewritten from *deps_file*."""
72-
ort_ver, genai_ver = _read_versions(deps_file)
69+
def _patch_pyproject_text(original: str) -> str:
70+
"""Return *original* with the ORT/GenAI version pins rewritten from deps_versions.json."""
71+
ort_ver, genai_ver = _read_versions()
7372
patched = _ORT_PIN_PATTERN.sub(lambda m: f"{m.group(1)}{ort_ver}", original)
7473
patched = _GENAI_PIN_PATTERN.sub(lambda m: f"{m.group(1)}{genai_ver}", patched)
7574
return patched
@@ -83,10 +82,10 @@ def _rewrite_version_pins() -> Generator[None, None, None]:
8382
versions; rewriting here keeps the wheel's declared pins in lockstep.
8483
"""
8584
original = _PYPROJECT.read_text(encoding="utf-8")
86-
patched = _patch_pyproject_text(original, deps_file=_DEPS_JSON_STD)
85+
patched = _patch_pyproject_text(original)
8786

8887
if patched == original:
89-
# Nothing to rewrite (e.g. JSON already matches and no name override).
88+
# Pins already match deps_versions.json — nothing to rewrite.
9089
yield
9190
return
9291

0 commit comments

Comments
 (0)