ORT 1.24.2 release cherry pick round 3#27378
Merged
tianleiwu merged 4 commits intorel-1.24.2from Feb 18, 2026
Merged
Conversation
Fix python packaging pipeline for 1.24.2 release. Previous attempt (#27339) to fix python packaging pipeline failed since powershell 5.1 does not support `-AsPlainText`. It has been verified that python packaging pipeline is good after this fix.
## Description
This pull request addresses the issue where the DirectML NuGet pipeline
has error like "##[error]A duplicate file name exists, or the file" in
Windows_CI_GPU_DML_Dev_arm64 step.
### Core Changes
1. **Automation Script**: Introduced bundle_dml_package.ps1 to
orchestrate the merging process:
- Extracts the base x64 `.nupkg`.
- Merges ARM64 binaries from a supplemental build artifact into the
`runtimes/win-arm64/native` directory.
- Repackages the resulting structure into a unified `.nupkg`.
2. **Pipeline Integration**: Updated dml-nuget-packaging.yml to include
a final `NuGet_Packaging_DML` stage. This stage is dependent on both the
x64 and ARM64 build stages.
3. **Extended Selection logic**: Updated select_dml_package.ps1 to allow
renaming artifacts (specifically for creating the supplemental ARM64
zip) and more robust package selection for development and release
builds.
4. **Validation Enhancements**: Included updates to
`validate_package.py` and `validate-package.yml` to support
multi-platform verification in future pipeline runs.
---
## Verification Results
The bundling logic was verified through the pipeline logs in the
`NuGet_Packaging_DML` stage.
### Execution Logs
- **Successful Extraction**: The script correctly extracted the
`win-dml-arm64.zip` and the base
`Microsoft.ML.OnnxRuntime.DirectML.1.24.1.nupkg`.
- **Injection Proof**:
- Created the `runtimes/win-arm64/native` directory inside the package
extraction folder.
- Copied `onnxruntime.dll`, `onnxruntime.lib`, and
`onnxruntime_providers_shared.dll` into the ARM64 runtime path.
- **Unified Package Creation**: 7-Zip successfully created the new
archive containing **34 files** (up from 31 in the original x64-only
package).
- **Size Increase**: The package size increased from **~6.6 MB** to
**~12.4 MB**, reflecting the inclusion of binaries for both
architectures.
> [!IMPORTANT]
> **Artifact Note**: When verifying the CI output, the unified
multi-arch package is located in the **`packages`** artifact produced by
the `NuGet_Packaging_DML` stage. Intermediate artifacts like
`drop-nuget-dml` still contain the single-architecture (x64) version.
### Description As title. Without including these DNNL files, it results in a link error because it is unable to locate the definition for `DnnlHasBF16Support()` defined in the file ### Motivation and Context Fix build error
…27374) ## Summary This PR enables ONNX Runtime to correctly load models with external data when they are stored in symlinked directory structures. This is a common scenario for models cached by the Hugging Face Hub, where both the model file and data files are symlinks pointing into a flat `blobs/` directory. ## The Problem Previously, ONNX Runtime's external data path validation would only check if the resolved data path was under the logical directory of the model. In symlinked structures (like Hugging Face's `snapshots/` and `blobs/` layout), the resolved data path often sits in a different physical directory than the logical model path, leading to a "path escapes model directory" error even when the data is safely associated with the model. ## The Fix I have updated `ValidateExternalDataPath` to implement a dual-check mechanism: 1. **Logical Check:** Verify if the resolved data path is under the provided `base_dir` (the directory where the model was loaded from). 2. **Physical Check:** If the logical check fails, verify if the resolved data path is under the parent directory of the **real/canonical** model path. This approach ensures that models can load external data from both their logical siblings and their physical siblings while maintaining security constraints. ## Changes - **Core Logic:** - `onnxruntime/core/framework/tensorprotoutils.cc/h`: Updated `ValidateExternalDataPath` to accept `model_path` and perform the dual-check. - `onnxruntime/core/graph/graph.cc`: Updated call site in `ConvertInitializersIntoOrtValues` to pass the `model_path`. - **Cleanup:** - Removed unused `ValidateExternalDataPath` from `provider_api.h`, `provider_interfaces.h`, and `provider_bridge_ort.cc`. These were redundant as path validation is handled by core during session initialization. Provider has no need to validate it. - **Testing:** - Added `onnxruntime/test/python/onnxruntime_test_python_symlink_data.py` to simulate the Hugging Face Hub symlink structure and verify the fix.
edgchen1
approved these changes
Feb 18, 2026
baijumeswani
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This cherry-picks the following commits for the release: