Skip to content

Map CPU model weights on macOS to avoid RAM refusals - #18

Merged
Vect0rM merged 1 commit into
atomicfrom
codex/sdcpp-macos-cpu-mmap
Dec 2, 2026
Merged

Vect0rM merged 1 commit into
atomicfrom
codex/sdcpp-macos-cpu-mmap

Conversation

@Vect0rM

@Vect0rM Vect0rM commented Dec 1, 2026

Copy link
Copy Markdown
Member

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

@Vect0rM
Vect0rM merged commit d59292a into atomic Dec 2, 2026
371 of 388 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant