Repository navigation
Map CPU model weights on macOS to avoid RAM refusals - #18
Merged
Merged
Conversation
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.
The signed 1163 build can refuse to generate the first FLUX.2 Klein image on the standard macOS arm64 runner. The published 1106 build completed the same test. The 1163 model manager requests a new CPU buffer for the model weights and reserves an additional GiB of host memory.
Use sd.cpp's existing file mapping for CPU-only contexts on macOS when callers leave mmap and parameter placement at their defaults. The backend assignment parser handles per-module overrides. GPU placements and explicitly configured contexts keep their existing behavior. The allocator still checks memory for graph buffers and weights that must be copied. Older Atomic Chat cores can use the change without passing a new flag.
Locally, both test binaries saw at most 2,946,596,864 bytes from the macOS available-memory query. The original 1163 failed during prompt encoding with a request for 1,930,510,848 bytes and 1,872,855,040 available. With this patch, the same core, model files and limit completed image generation, cancellation and another generation. A separate clean build without the diagnostic cap also passed the image live tests on core v0.24.13. The diagnostic cap is confined to the local experiment.
Previous signed-release check