Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by frikk on Tuesday March 24, 2026 @12:46PM
(#47505525)
This is interesting work, thank you for sharing. What hardware would you buy today for experimenting? Seems like the new gen of macbook pros are pretty powerful?
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by tatef on Tuesday March 24, 2026 @02:38PM
(#47507207)
Yes definitely. I use a M1 Max with 32gb of RAM daily and it's about on par from a performance standpoint with the new base M5 Pro 24gb. You can check the benchmarks in the repo if you're interested in seeing specific performance metrics, but investing in Apple hardware with as much memory as possible will generally get you furthest in this game.
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by lostmsu on Tuesday March 24, 2026 @12:47PM
(#47505543)
Why would llama with --mmap crash?
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by zozbot234 on Tuesday March 24, 2026 @12:58PM
(#47505746)
This doesn't surprise me all that much, mmap support gets little attention in general and interacts poorly with GPU-side inference. (And that's with it being default, you don't even really need to specify it as a CLI option.) OP has raised a discussion with the llama.cpp folks https://github.com/ggml-org/llama.cpp/discussions/20852 but little interest so far
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by lostmsu on Wednesday March 25, 2026 @07:54AM
(#47516132)
But if mmap already works why would there be any interest?
Besides, discussions are for users. He didn't open PRs or issues.
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by causal on Tuesday March 24, 2026 @12:50PM
(#47505603)
You need to change the title or actually include 1T parameter model content.
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by password4321 on Tuesday March 24, 2026 @12:50PM
(#47505606)
Don't post generated/AI-edited comments. HN is for conversation between humans
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by tatef on Tuesday March 24, 2026 @02:36PM
(#47507177)
Noted, thanks. I had LLM help positioning this message but I did the initial draft along with edits. Will keep in mind for the future.
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by DennisP on Tuesday March 24, 2026 @01:15PM
(#47505993)
That doesn't read like an AI-generated comment to me. He did mention he vibe-coded the project but that's not against the guidelines.
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by Retr0id on Tuesday March 24, 2026 @01:26PM
(#47506192)
It's either written by an LLM, or written by someone who learned to write by reading LLM output
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by password4321 on Tuesday March 24, 2026 @01:27PM
(#47506202)
Vibe-coded project is fine.
At least prompt your LLM to dodge the obvious tells when commenting!
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by Forgeties79 on Tuesday March 24, 2026 @01:23PM
(#47506143)
gptzero says 99% chance it’s AI-generated
It certainly has a lot of telltale signs
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by Izikiel43 on Tuesday March 24, 2026 @01:17PM
(#47506049)
> The core insight:
That's a telltale sign of ai written text.
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by WithinReason on Tuesday March 24, 2026 @12:55PM
(#47505694)
Have you ever generated access frequency statistics for the experts in these models, something like a histogram?
Re:Run a 1T parameter model on a 32gb Mac by streaming tenso...
by Gracana on Tuesday March 24, 2026 @01:18PM
(#47506058)
ktransformers can do dynamic placement of experts and could presumably produce such a histogram, though currently its activation statistics are just a ".pt" file. https://github.com/kvcache-ai/ktransformers/blob/main/doc/en...
FWIW I never got it to work and did not dig into it much.
The core insight: most of a model's weights aren't needed every token. For MoE models like Mixtral, only 2/8 experts fire per token. Hypura keeps the non-expert tensors (~1 GB) on Metal and streams expert data from NVMe through a small pool buffer. A neuron cache hits 99.5% after warmup, so steady-state NVMe I/O is near-zero. Vanilla llama.cpp OOMs on the same model — Metal counts the full mmap'd file against recommendedMaxWorkingSetSize even when only a fraction is GPU-offloaded.
For dense models (Llama 70B, 40 GB), it keeps attention+norms on GPU (~8 GB) and streams FFN tensors from NVMe with prefetch lookahead. Slower (0.3 tok/s), but the alternative is a crash.
Numbers on M1 Max 32 GB (~5.1 GB/s NVMe):
- Mixtral 8x7B Q5_K_M (31 GB): 2.2 tok/s. llama.cpp: OOM at any ngl setting. - Llama 3.3 70B Q4_K_M (40 GB): 0.3 tok/s. llama.cpp: OOM. - Qwen 2.5 14B Q4_K_M (8.4 GB): 12.3 tok/s. No overhead when the model fits in memory.
It also exposes an Ollama-compatible HTTP API (/api/chat, /api/generate), so it's a drop-in for anything that talks to Ollama.
Written in Rust, wraps llama.cpp via FFI, MIT licensed.
Honest disclosure: I directed the architecture and design decisions, but the code was largely written by LLMs (Claude). I used the Socratic method — asking questions, proposing approaches, evaluating tradeoffs — while the models did the implementation. I think this is worth being transparent about. The hunch that motivated it: NVMe-backed inference is underutilized despite being a slow but perfectly valid memory tier, especially on Apple Silicon where unified memory + fast SSDs are the norm.
Limitations I won't bury: dense FFN-streaming is I/O-bound (~50 ms per-layer stalls on each of 80 layers). Co-activation predictions need ~100 tokens to warm up. The optimize command rewrites the full model file. This is early and rough.
Happy to answer questions about the placement LP, the custom GGML buffer type, or what I learned about Metal's mmap behavior on Apple Silicon (it's weird).