Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Cleanup external data path validation - #27539

#27539
Merged
adrianlizarraga merged 30 commits into
mainmicrosoft/onnxruntime:mainfrom
adrianl/InMemModel_ExtDataPath_SymLinkCheckmicrosoft/onnxruntime:adrianl/InMemModel_ExtDataPath_SymLinkCheckCopy head branch name to clipboard
Mar 14, 2026
Merged

Cleanup external data path validation#27539
adrianlizarraga merged 30 commits into
mainmicrosoft/onnxruntime:mainfrom
adrianl/InMemModel_ExtDataPath_SymLinkCheckmicrosoft/onnxruntime:adrianl/InMemModel_ExtDataPath_SymLinkCheckCopy head branch name to clipboard

Conversation

@adrianlizarraga

@adrianlizarraga adrianlizarraga commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Description

  • Updates the ValidateExternalData() function:
    • Resolves symlinks when validating external data path for models loaded from memory.
      • Previously only did a lexical check that did not resolve symlinks. Now, we resolve symlinks.
    • Now requires external data path to exist.
    • Replace the (base_dir, model_dir) function parameters with just model_dir. base_dir was always derived from model_dir.
    • Skip validation for WASM builds that do not have a filesystem.
    • Return Status instead of throwing exceptions when std::filesystem functions fail.
  • Updates Graph::ConvertInitializersIntoOrtValues():
    • Prevents unnecessary calls to ValidateExternalData() for external data paths that have already been validated.

Motivation and Context

@adrianlizarraga
adrianlizarraga requested a review from Copilot March 5, 2026 16:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@adrianlizarraga
adrianlizarraga requested a review from Copilot March 5, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@adrianlizarraga
adrianlizarraga marked this pull request as ready for review March 6, 2026 20:04

@yuslepukhin yuslepukhin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am having a hard time reviewing since my tools are not working.

See the tests that I introduced in my DRAFT PR in connection with my comment.

Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.h Outdated
Comment thread onnxruntime/test/framework/tensorutils_test.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.h Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.h Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.h Outdated
Comment thread onnxruntime/core/framework/tensorprotoutils.cc Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.