Fix EPContext node referencing MXR files that are never written - #69
Open
ivarusic-amd wants to merge 4 commits into
Open
Fix EPContext node referencing MXR files that are never written#69ivarusic-amd wants to merge 4 commits into
ivarusic-amd wants to merge 4 commits into
Conversation
…tten When ep.context_enable was set without cache_dir (or with disable_caching), the generated EPContext node referenced/embedded a .mxr file that the EP never actually saved to disk, breaking the model on load. Default the cache directory to context_file_path's or the model's directory in that case, always persist the .mxr when context_enable is on, and fail fast instead of emitting a broken node when the graph has dynamic input shapes.
urpetkov-amd
previously approved these changes
Jul 29, 2026
Collaborator
|
LGTM |
TedThemistokleous
requested changes
Jul 30, 2026
TedThemistokleous
left a comment
Collaborator
There was a problem hiding this comment.
Overall looks good just need to update comment to represent new state regarding the added dynamic batch functionality using the ORT flags
| "ep.context_enable is set but the graph has dynamic input shapes at compile time; " | ||
| "MIGraphX EP cannot produce a single MXR cache file up front for this subgraph. " | ||
| "Provide static input shapes (or fix the shapes before session creation) to use " | ||
| "EPContext model generation with the MIGraphX EP."); |
Collaborator
There was a problem hiding this comment.
With the hip graph and recent changes, we do support dynamic batching currently by leveraging MXR files. We should update this to represent that path forward should the user request dynamic batch and the ORT_MIGRPAHX_USE_SPECIFIC_BATCH or ORT_MIGRAPHX_MAX_DYNAMIC_BATCH are set
Collaborator
Author
There was a problem hiding this comment.
I updated it; feel free to change it if i missunderstood somehting
ivarusic-amd
force-pushed
the
fix_epcontext_mxr_cache_dir
branch
from
July 30, 2026 12:56
712eb97 to
299aa4b
Compare
ivarusic-amd
marked this pull request as ready for review
July 31, 2026 09:22
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.
When ep.context_enable was set without cache_dir (or with disable_caching), the generated EPContext node referenced/embedded a .mxr file that the EP never actually saved to disk, breaking the model on load. Default the cache directory to context_file_path's or the model's directory in that case, always persist the .mxr when context_enable is on, and fail fast instead of emitting a broken node when the graph has dynamic input shapes.
Is defaulting to the original model's directory (rather than erroring out) the right last resort, or should we require the user to set at least one of cache_dir/context_file_path explicitly when context_enable=1?
Should context_enable=1 on a dynamic-input-shape graph hard-fail?
NOTE : need to retest if everything else stays unchanged before merge