Skip to content

Cleanup external data path validation#27539

Merged
adrianlizarraga merged 30 commits into
mainfrom
adrianl/InMemModel_ExtDataPath_SymLinkCheck
Mar 14, 2026
Merged

Cleanup external data path validation#27539
adrianlizarraga merged 30 commits into
mainfrom
adrianl/InMemModel_ExtDataPath_SymLinkCheck

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