Improve DirectStorage fallback and CUDA runtime discovery - #98
Conversation
Use the nogds copier when DirectStorage DLLs are absent from auto-discovered locations, while preserving errors for invalid explicit configuration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Charles Zhang <3822520+chinazhangchao@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Charles Zhang <3822520+chinazhangchao@users.noreply.github.com>
|
Hi @takeshi-yoshimura, could you please help to review? We’re seeing this issue when using fastsafetensors on Windows. |
|
While we're here: both version selections sort lexicographically, so a two-digit major loses to a one-digit one — on this branch a directory holding It predates this PR so entirely your call, but you're editing the glob directly above |
Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
4ef90a0 to
2c002f9
Compare
takeshi-yoshimura
left a comment
There was a problem hiding this comment.
@chinazhangchao generally looks good (and good catch @gitbisector). could you please fix some exceptional cases as I commented?
Use framework-provided runtime directories when initializing DirectStorage so bundled CUDA runtimes are discovered. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Chao Zhang <zhangchao@microsoft.com>
4d14349
into
foundation-model-stack:main
|
Merged. thanks. |
This pull request improves the handling of DirectStorage and CUDA runtime library discovery, especially for Windows environments and framework-bundled runtimes (such as PyTorch). It adds robust fallback mechanisms, better error handling, and framework-aware runtime selection. The changes also introduce new tests covering these scenarios.
DirectStorage fallback and error handling:
dstorage) now falls back to thenogdscopier if the required DLLs are not installed and emits a warning only once. However, if an explicit DLL directory is set but invalid, it raises an error instead of falling back. [1] [2] [3]DirectStorageUnavailableErrorto distinguish between missing DLLs and explicit misconfiguration. [1] [2]CUDA runtime library discovery improvements:
torch\lib) before falling back to system locations, and an explicit environment variable always takes precedence. [1] [2] [3] [4]get_runtime_lib_dirsmethod to supply trusted directories for bundled GPU runtimes. This is implemented for PyTorch. [1] [2] [3]Documentation updates:
Expanded test coverage: