01 / The idea
Select weights from the prompt, then prefetch them.
A model with 128 experts per layer uses only 8 of them for each token: 7 routed experts and 1 shared expert. If the experts that a whole request will use can be predicted before it runs, a server can keep only those experts in GPU memory and read others from storage when the topic changes. Three separate things must hold for this to work. The selected pool must keep the answers. The prediction must be cheap and come early. And the reads must finish before the GPU needs the weights.
What IFP does
A predictor reads the prompt and outputs a mask over the feed-forward channels of a dense model. The predictor and the model are trained together, and the mask stays fixed during decode. The paper measures latency with a GPU simulation of flash, not with a storage device.
What we changed for MoE
EMO already groups experts by domain, so the unit of selection is a whole pool: 32 routed experts plus the shared expert in each of 16 layers. Nothing is trained. A logistic regression on the mean input embedding of the question picks one of five pools in under 1 ms. The pool is read from NVMe into registered GPU memory with io_uring. Routing inside the pool stays dynamic.
This is not a reproduction of IFP. No trained IFP predictor exists for EMO, so this page makes no IFP comparison. The broad idea is not new either. Apple's third-generation foundation model announcement describes prompt-based routing with weights loaded from flash. LLM in a Flash and ProMoE cover sparse flash reads and predictive expert caching. What this page adds is measurement on an open model with real storage. It answers what pool quality, selector cost, storage layout, lead time and switch policy a working server needs.
02 / Setup
One model, five domains, one GPU, one drive.
The model is allenai/Emo_1b14b_1T, converted bit-exactly to BF16 (25.3 GiB). It has 16 layers and 128 experts per layer, one of them shared. The test machine has one AMD Radeon Pro W7900 GPU with 48 GB of memory, running ROCm 6.4 and PyTorch 2.9.1. Its single NVMe SSD reads about 7.5 GB/s into registered GPU memory. MoE layers use vLLM's fused MoE Triton kernel, with tile sizes tuned for this GPU. The kernel is Linux 7.3 with the io_uring DMA-BUF series described on the DMA-BUF + io_uring page.
There are five domains. ARC-Challenge is one. The other four are MMLU categories: health, psychology, history and politics, where politics covers four MMLU subjects. Each domain has 8 calibration texts for its pool, 128 selector-training questions and 128 test questions, and no question appears in two sets. Answers are scored as ranked multiple choice. The stream is 640 test requests in runs of one domain, with a mean run length of 16. Each request is prefilled and then decodes 16 tokens, at batch size one. A request takes about 0.25 s.
The reference is the same server with all five pools resident, serving the same requests on the same pools. Every request's first-token logits and generated tokens must match that reference bit for bit, and every loaded layer must equal its resident copy. All results on this page passed that check with no exception.
03 / Pool quality
A domain's own pool keeps the answers. A wrong pool does not.
Each pool keeps, in every layer, the 32 routed experts with the highest mean router probability on its domain's 8 calibration texts, plus the shared expert. Layers are chosen in order with earlier layers already restricted, as in EMO's own selection code. A pool is 25% of the routed experts. With the attention, embedding and shared weights, the pool model takes about 8 GB of GPU memory, against 27 GB for the full model.
| Domain (128 questions) | Full model | Own pool | Worst other pool |
| ARC-Challenge | 72 | 71 | 38 (history pool) |
| Health | 69 | 61 | 42 (ARC pool) |
| Psychology | 78 | 77 | 54 (history pool) |
| History | 63 | 60 | 34 (psychology pool) |
| Politics | 53 | 52 | 40 (health pool) |
| All five | 335 | 321 | — |
Correct answers out of 128 per domain. "Own pool" is the right pool for every request, which is the most a selector can reach.
Most wrong picks cost 11 to 34 answers out of 128. The exception is health and psychology, which share many experts. So the selector matters, and the cost of an error depends on which pool it confuses. Pools from different domains overlap little: per layer, only about 6 experts are in all four of the first four pools. One general pool cannot replace them. The best shared pool tested, calibrated on all five domains with equal weight, answers 303 of 640. Politics needs its own pool. A politics pool answers 52 against the full model's 53, but no shared pool of 32, 40 or 48 experts gets politics above 46. Politics is short of pool slots, not short of experts.
04 / The selector
A classifier on the question's mean embedding.
The selector reads only the question text: no demonstrations and no answer choices. It averages the model's input-embedding rows over the question's tokens (2,048 numbers; no transformer layer runs) and applies multinomial logistic regression. The regression is fitted on 32 training questions per domain, with its penalty chosen by 4-fold cross-validation. Offline it names the right domain for 505 of 640 test questions (79%).
| Selector, on the live stream | Served (of 640) | Pick cost | Notes |
| Embedding logistic regression, 32 per domain | 320 | 0.2–1 ms | Adopted. No GPU layer, no dependence on the loaded pool. |
| Router logistic regression, first 4 layers, 128 per domain | 313 | 7.9 ms | Must be fitted separately for each loaded pool; 3.1% of wall time. |
| Embedding nearest centroid, 128 per domain | 308 | microseconds | Good with four pools, weak with five. |
| Right pool every time | 321 | — | Upper bound. |
Router features looked stronger offline, but they shift once a pool is loaded. Layer 0's router sees the same input whatever pool is loaded, but the routers of layers 1 and later see hidden states that the pool's experts produced. The cosine similarity to full-model features falls to 0.87 at layer 1 and to 0.62 at layer 15. Router selectors fitted on full-model features all fail with a pool loaded: under the worst loaded pool they serve only 279 to 298 of 640. Refitted for each loaded pool they recover, but on the live stream they still serve fewer answers than the embedding selector, and each pick runs four GPU layers. The embedding selector has none of these problems. The server's switch policy (below) also absorbs single wrong picks: offline the embedding selector would serve 314, and on the stream it serves 320.
05 / What prefetching needs
Lead time in seconds, and reads of only what changes.
A whole pool is 6.4 GB of routed experts. One drive reads it in about 0.88 s. One request takes about 0.25 s. A prefetch that starts two requests early therefore has 0.5 s to hide a 0.88 s read. What matters is how many seconds of work lie ahead, not how many requests. The table shows each step that closed this gap on the saturated stream, with a lookahead of Q requests.
| What a switch reads | Q | Throughput loss | Holds the 5% bar? |
| Follow every selector pick, whole pool | 0, 2 | 176–276% | No: a single odd pick starts a switch |
| Debounce (two agreeing picks), whole pool | 2 | 22.3% | No: 0.89 s read against 0.48 s lead |
| Debounce, whole pool | 4 | 5.1% | No, by a small margin |
| Debounce, delta files (only the new pool's missing experts) | 2 | 3.2% | No: switches into history still wait 71 ms |
| Debounce, delta files | 4 | 2.4% | Yes |
| Debounce, slot store from a single-copy layout, five pools | 4 | 1.2–1.6% | Yes, with 11 GB of registered GPU memory |
Four pools except the last row. Loss is wall time against the resident server serving the same picks. The switch wait is the extra first-token time of a switched request; the median is 0.4 ms or less in every passing row.
Debounce
The server keeps its loaded pool unless both the current request and the next one pick the same other pool. A run of one domain then switches once, and a single wrong pick in the middle of a run costs no switch. It also explains why the selector serves more on the stream than offline: an odd wrong pick inside a run lands on the run's pool.
Delta reads
Two pools of different domains share 167 to 332 of their 512 routed experts, counted over all 16 layers. A switch that reads only the 180 to 345 missing experts moves 2.3 to 4.3 GB instead of 6.4 GB and finishes in 0.38 to 0.61 s, depending on the pair, at 6.0 to 7.1 GB/s. Small deltas pay a fixed setup cost, so they read at the lower rates.
One copy on disk, slots on the GPU
Packing every pool and every pool-to-pool delta as its own file stores each expert several times: about 158 GiB for a 26 GiB model. The single-copy layout stores each expert once per layer. It orders the experts by the reflected Gray code of their pool-membership masks, so each pool is 1 to 8 contiguous runs per layer, and the last pool in the order is always one run. A new pool is then a list of runs and needs no writes. It reads as fast as the packed files (median time ratio 1.000, worst 1.014). On the GPU, each layer has one registered buffer of 52 to 57 expert slots, 11.0 GB in all, registered with io_uring once. A switch reads the missing experts from disk straight into free slots, and the layer runs through a slot map. Nothing is copied on the GPU, and nothing is allocated per switch.
Two fixes below the server
Releasing a DMA-BUF registration waited about 14 ms for an RCU grace period in dma_buf_io_kill_map(). Two kernel patches make the release asynchronous and save 180 to 191 ms on a 25.3 GB whole-model load (branch 2026-11-06-dmabuf-io-async-release). Pool switches in the server below gain nothing from them, because the server registers its slot buffers once at startup and a switch releases no registration. On the patched kernel the median switch read stays at about 400 ms, and the stream results do not change. Weights used in place must also start on a page. The DMA-BUF copier puts each tensor at its file position within a 4 KiB page, and a pool file whose data started at byte 280 made the fused MoE kernel about twice as slow as on a fresh copy. The pool files are therefore packed with the tensor data at byte 4096, and the pool loader asks the fastsafetensors DMA-BUF copier for 4096-byte alignment, which moves an unpacked file instead of using it slowly. The copier itself moves nothing by default, because engines that copy weights into their own parameters only lose time to a move. Tensor alignment in DMA-BUF loads explains this and gives the measurements.
06 / Random arrivals
The switch rule must read the queue.
A saturated stream always has four requests waiting, so the server can see what comes next. Real arrivals are not like that. In this test, requests arrive with exponential gaps at 0.3, 0.6 and 0.9 of the resident server's capacity. The server sees only requests that have arrived, picks each pool live, prefetches visible requests up to four ahead, and starts cold on the ARC pool. The resident server replays the same arrivals with the same pools. The bars are a median at most 1.5 times, and a 99th percentile at most 2 times, the resident server's latency (queueing plus first token). Quality must stay within 4 answers of the simplest rule.
| Rule | What it does when the next request has not arrived | 0.3 | 0.6 | 0.9 |
| Switch at once | Switches on this request's pick | 8.89× · 317 | 3.51× · 316 | 1.34× · 320 |
| Hold | Switches when this pick agrees with the previous one; prefetches the pick meanwhile | 1.01× · 305 | 1.53× · 314 | 1.23× · 318 |
| Confident | Hold, but switches at once if the selector's probability is at least 0.508 | 1.07× · 316 | 2.27× · 320 | 1.82× · 321 |
| Queue-aware | Debounce on the next request when it is visible; the confident rule only when the queue is empty | 1.07× · 316 | 2.02× · 317 | 1.25× · 319 |
Median latency ratio, then answers served out of 640. 99th-percentile ratios for the queue-aware rule: 1.62, 1.28 and 1.13. The confidence threshold gives 85% precision on out-of-fold training picks; it was chosen after a first look at test coverage showed that a 95% target covered only 6% of questions.
At light load the queue is usually empty, and switching at once wastes reads: 218 switches, only 17 with any lead, about 400 ms each. Holding fixes the latency but serves the first request after each domain change on the old pool, which loses 12 answers. A confident pick is right often enough to switch at once without that loss. At heavy load the queue usually shows the next request, and then plain debounce is best: the confident shortcut alone adds switches there (93 at every load). The queue-aware rule uses each signal where it exists. It holds up at 0.3 (median 40 ms against 37 ms) and at 0.9.
With one resident pool, no rule holds up at load 0.6. The queue empties and refills, so the rule makes confident switches that a request arriving a moment later would have stopped: 36 of its 80 switches had no time to prefetch.
Two resident pools
The slot store can keep more than one pool. With two, the server keeps the two most recently used pools in its slots. A request for either runs at once, with no read and no switch rule. The rule decides only switches to a third pool, and such a switch frees the slots that only the less recently used pool held. Each layer needs as many slots as any three pools hold together, 62 to 69 instead of 52 to 57, which is 13.1 GB instead of 11.0 GB.
| Queue-aware rule | Load 0.3 | Load 0.6 | Load 0.9 |
| One resident pool: median, p99, answers | 1.07× · 1.62× · 316 | 2.02× · 1.28× · 317 | 1.25× · 1.13× · 319 |
| Two resident pools: median, p99, answers | 1.02× · 1.23× · 315 | 1.44× · 1.63× · 318 | 1.17× · 1.06× · 319 |
| Two resident pools: pool loads, swaps between resident pools | 50 · 77 | 50 · 71 | 45 · 71 |
Ratios against the server with every pool resident, on the same arrivals and the same per-request pools; every output matched it bitwise. The one-pool rule made 82 pool loads at load 0.6 in the fresh-clone run.
Two resident pools hold every load within the bars (median at most 1.5 times, p99 at most 2 times). At load 0.6 the median falls from 2.02 to 1.44 times. The 99th percentile there rises from 1.28 to 1.63 times, still under its bar; we have not yet measured why the tail grows. Across the five pools, 69 to 76 distinct experts per layer cover all of them, 14.6 GB, so with this few domains every pool fits next to the others in a little over half of the full model's 25.3 GB. Switching earns its cost only when the pools a server needs do not fit together. A cold start remains: loading the first pool takes 0.87 s, and the first request waits about 0.5 s more if it needs another pool.
07 / What pools buy
Memory and prefill compute, not decode speed.
When the full model fits, the plain alternative is to keep it resident and never switch. On a four-pool version of the stream, that server took 184.7 s against 161.8 s for the pool server, about 14% slower, and gave the full model's answers everywhere. On matched requests the decode time per token is the same (14.46 against 14.40 ms), because each token uses 8 experts either way. Prefill is 41% slower on the full model, because a prompt's tokens spread over all 127 routed experts. The pool server also uses about 8 GB of GPU memory instead of 27 GB.
Pools are therefore most useful where the full model does not fit, or where memory is needed for other work such as a larger KV cache. Falling back to the full model for unknown domains does not keep up on one drive. A switch into the full model reads 19.1 GB in 2.64 s, and even a lookahead of 12 requests gives only about 1.5 s of lead. The fallback server loses 11.8% at that lookahead, and is only 2% faster than keeping the full model resident.
08 / Limits
What these results do not show.
There is one model, five domains, one GPU and one drive. The quality numbers come from 128 questions per domain, so a difference of a few answers is within noise. The stream is synthetic: runs of one domain, and Poisson arrivals at batch size one. No batching, no concurrent users, and no multi-drive striping were tested. The selector needs labelled questions for every domain, and it cannot detect a domain that has no pool. A centroid for a known unpooled domain can send that domain to the full model, but thresholds learned from pooled domains alone cannot. The comparison with a standard (non-EMO) MoE of the same size has not been run, so this page does not claim that EMO's training is what makes pools work. Only the AMD ROCm path was tested; NVIDIA GPUs need a driver that exports GPU memory as DMA-BUF.
09 / Run it
One defconfig reproduces the adopted server.
The knlp defconfig downloads the checkpoint at a pinned revision and builds the five data sets at pinned dataset revisions. It checks each data file against the hash of the published one. It then converts the model to BF16, tunes the fused MoE kernel, calibrates the five pools (each checked against the published membership), and scores every pool on every domain. Then it packs the experts on the local drive, computes selector features, and serves the stream: a saturated pass and random arrivals at three loads under the queue-aware rule, each checked bitwise against the resident server. It needs a GPU with about 48 GB, a kernel with io_uring DMA-BUF registration, and about 230 GB of space on the NVMe drive under test.
# the published run: 640 requests, loads 0.3, 0.6 and 0.9
make defconfig-emo-ifp
make
# the same stages, then 40 requests and one load
make defconfig-emo-ifp-smoke
make
# one stage at a time, or the plan
make emo-ifp-doctor
make emo-ifp-plan
make emo-ifp-pools
The driver is tools/reproduce/emo_ifp/run.py, and the options are in Kconfig.emo_ifp. The defconfig pins fastsafetensors 9f77b8c; the published results used a174cd2, and the two place tensors the same way in this pipeline because the pool files are packed at 4096 (see versions). CONFIG_KNLP_EMO_IFP_RESIDENT_POOLS=2 runs the server with two resident pools. Existing BF16 weights, a tuned kernel table or a built reader can be reused through CONFIG_KNLP_EMO_IFP_MODEL_BF16_DIR, _TUNED_CONFIGS and _FST_DIR. The driver reports each pool as matching or differing, and does not stop when one differs. Results land in REPORT.md and serve/mixed-stream.json under the data root. The experiment scripts are in scripts/emo_ifp: calibrate_pool.py builds a pool, pack_single_copy.py writes the single-copy layout, slot_store.py holds the GPU slots, and mixed_stream.py is the server and its checks. Each script's docstring documents what it measures.
A run from a fresh clone
We ran make defconfig-emo-ifp and make from a fresh clone of knlp, with an empty data root, on the same GPU and drive. Only the Python interpreter was set by hand. The download took 16 minutes and the GPU stages 64 minutes. All 15 data files matched the published hashes, and the BF16 conversion produced shards byte-identical to the published conversion. Four of the five pools matched the published membership. The ARC pool differed in one expert of one layer, where two experts' mean router probabilities differ by 0.00002; two separate rebuilds gave the same ARC pool, so the rebuild is repeatable and the published pool sits on the other side of a numeric near tie. The rebuilt ARC pool answers 72 of 128 ARC questions instead of 71, and that one question accounts for the extra answer in each row below. Every served output matched the resident server bitwise.
| Measure | Published | Fresh clone |
| Saturated stream: throughput loss, answers of 640 | 1.2–1.5% · 320 | 1.63% · 321 |
| Queue-aware, load 0.3: median, p99, answers | 1.07× · 1.62× · 316 | 1.05× · 1.64× · 317 |
| Queue-aware, load 0.6: median, p99, answers | 2.02× · 1.28× · 317 | 2.14× · 1.29× · 318 |
| Queue-aware, load 0.9: median, p99, answers | 1.25× · 1.13× · 319 | 1.23× · 1.11× · 320 |
Ratios are against the server with every pool resident, on the same requests. The fresh run's saturated loss is 0.1 points above the published range; it made 60 pool switches, and 82% of them were hidden behind other work. Load 0.6 still fails the 1.5× median bar, as published.