Elastic Gang: Per-Token Membership Change for a Hard-Barriered LLM Inference Gang Co-Scheduled with OS Processes

Daeyeon Son 2026-07-07

The problem is that on-device LLM decoding is a hard-barriered CPU-SIMD computation requiring all cores per token, but preemptive scheduling causes deadlock or silent logit corruption. The method introduces the elastic gang in Anima OS, using an ACK-latched epoch protocol with generation-tagged latches and RCU-style membership consent to allow per-token core membership changes without waiting on named cores. Experimental evidence on AMD Zen 5 shows bit-exact inference under per-token membership changes for 135M and 7B models, with 1.75x, 1.52x, and 1.28x general throughput improvements over static 8-core splits at 25%, 50%, and 75% inference duty cycles, and core return costs of 0.22 us. This matters because it enables safe, dynamic core sharing between LLM inference and OS processes, Pareto-dominating static partitions and auto-sizing the gang online to maximize throughput without stranded cores.

PDF