FIX #245 - Set required DirectML session options (memory_pattern + sequential execution)#246
Merged
Anush008 merged 2 commits intoAnush008:mainfrom Apr 10, 2026
Conversation
Anush008
approved these changes
Apr 10, 2026
Owner
Anush008
left a comment
There was a problem hiding this comment.
LGTM!
Thanks for taking the time to contribute @markgandolfo.
github-actions bot
pushed a commit
that referenced
this pull request
Apr 10, 2026
## [5.13.2](v5.13.1...v5.13.2) (2026-04-10) ### 🐛 Bug Fixes * Set required DirectML session options (memory_pattern + sequential execution) ([#246](#246)) ([138602f](138602f))
|
🎉 This PR is included in version 5.13.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
proposed fix for #245
DirectML requires two ONNX Runtime session options that fastembed wasn't setting:
enable_mem_patternmust be falseexecution_modemust be sequential (not parallel)Without these, DirectML can OOM on operations that would otherwise fit in VRAM. This became visible after candle 0.10 changed GPU memory allocation patterns.
on the directml page
Changes:
directml = ["ort/directml"]feature flag in Cargo.tomltry_newandtry_new_from_user_definedin bothtext_embedding/impl.rsandimage_embedding/impl.rs) to detect DirectML at runtime and apply the required settings#[cfg(feature = "directml")]guards so it compiles on all platforms