Fix Windows safetensors load order to prevent crash #61
+8
−4
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.
Summary
SingleGPUModelBuilder.build()to prevent segfault on WindowsProblem
On Windows, loading a large safetensors file (41GB BF16 model) crashes with segfault when Gemma is already loaded in memory. This appears to be a safetensors memory mapping issue specific to Windows.
Solution
Load the state dict before applying module_ops (which load Gemma). This ensures the safetensors file is opened before Gemma occupies memory, avoiding the crash.
Test plan
ltx-2-19b-dev.safetensors) now loads and runs successfully🤖 Generated with Claude Code