HotPin: Solving the MoE RAM problem – selective expert pinning for llama.cpp #25469
LozzKappa
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I've been working on a project called HotPin that solves a specific problem with MoE models: when the model is bigger than available RAM,
--mlockfails because it tries to lock the entire model.HotPin takes a different approach. Instead of locking everything, it:
mlock(Linux) /VirtualLock(Windows) only on those hot expert tensorsmmapThe result is lossless (SHA-256 bit-identical to a full-RAM run) with drastically reduced RAM usage.
Tested on AMD Ryzen AI 9 HX 370 (23.6GB RAM, Zen5, AVX512):
Boundary condition I found:
The patches are ~50 lines of C++ in
llama-model.cpp. There's also anautoconfig.pythat reads free RAM and applies the right config.📄 Full paper + code: github.com/LozzKappa/hotpin-llm (includes paper PDF + LaTeX source)
📄 Looking for arXiv endorsement in cs.LG – if any researcher with an arXiv account can help, I'd really appreciate it!
Would love to hear feedback from the maintainers and the community!
All reactions