Repository navigation
Description
Ran the -ot planner from #9675 against --fit on on a consumer host, since the numbers behind the default in #9779 come from datacenter cards with a 192-core host. 76 paired cells, 152 loads, 7 models, all single-file GGUFs.
Host
| CPU | i5-12400F, 6 cores / 12 threads |
| RAM | 94 GB, dual channel |
| GPU 0 | RTX 6000 Ada, 48 GB |
| GPU 1 | RTX 3090, 24 GB |
| Context | 32768, 4 slots, flash attn on, --load-mode none |
Build tested
Started from b26ca1194a, where every planned load raised 'LlamaCppBackend' object has no attribute '_HOST_RAM_HEADROOM_MIB' and returned a 500. That is #9821, which landed partway through this run. The measurements were taken with the same one-line change #9821 makes.
They still describe current main (8702247482). Across the 50 commits merged since the tested tree, offload_planner.py, offload_cost_model.py and offload_layout.py are byte-identical; _planned_tensor_spill differs only by #9821's line; and _spill_plan_flags_for, the _spill_inputs snapshot, the elif use_fit: gate, _gpu_usable, _vram_usable_mib, _active_vram_fraction and _PIPELINE_PER_DEVICE_OVERHEAD_MIB are unchanged. The new memory_contract.py from #9830 is not imported by llama_cpp.py, so it does not feed the planner's budget.
Method
Both arms come from the same running backend. The planner declines on any explicit --fit in passthrough args (llama_cpp.py:24868-24874 on main), which gives the baseline without a restart:
- Arm A:
llama_extra_args: [],gpu_memory_mode: auto. Planner may act. - Arm B:
llama_extra_args: ["--fit","on"]. Byte for byte what the abstain branch emits atllama_cpp.py:20380.
Cards selected with gpu_ids, which narrows the probe before the planner's input snapshot and does not trip an abstain the way --device would. Free VRAM set by a process holding a fixed allocation on the target card, because UNSLOTH_VRAM_FRACTION clamps to [0.80, 1.00] (utils/vram_budget_settings.py:36) and cannot express a small budget.
Budgets were not guessed. The planner was first driven offline through plan_placement and calibrated against the plans Studio actually produced: it reproduces all five to within 0.1 GiB at an effective per-device overhead of 4.0 to 6.1 GiB. 368 budgets per model were then swept to locate each regime boundary, and every cell's allocation derived from that. Predicted against actual, for example on the 70B: predicted 15 of 80 blocks and 7.15 GiB to host, measured 15 blocks and 7.2 GB.
Each arm: load, one discarded warm-up, then 3 measured requests (7 for every win and every high-variance cell). Throughput read from llama-server's own timings via the final SSE chunk.
Request shape, which matters for reading the generation column and is the main limitation of these numbers:
| Prompt | 2311 to 2362 tokens, depending on tokenizer |
| Generated | 128 tokens, max_tokens: 128, temperature 0 |
| Sequence length ever live | about 2.2K tokens, against n_ctx 32768 |
| Prefill requests | unique prompt per request so the prompt cache cannot serve it, 8 output tokens |
| Generation requests | one fixed prompt, so both arms decode identical tokens and the MTP drafter's acceptance rate is identical |
The cache is allocated at 32768 but only about 2.2K tokens of it are ever populated. The planner's trade is to spend host-resident weight bytes in order to keep the cache on the GPU, and at this sequence length the cache it protects is nearly empty:
| model | KV allocated at 32K | KV live at 2.2K tokens | weights the planner moved to host |
|---|---|---|---|
| Qwen3.6-35B-A3B | 0.62 GB | 0.04 GB | 3.9 to 17.5 GB |
| Qwen3.8-27B | 2.00 GB | 0.13 GB | 7.0 to 11.5 GB |
| Qwen3-8B | 4.50 GB | 0.30 GB | 2.3 to 2.8 GB |
| Llama-3.3-70B | 10.00 GB | 0.66 GB | 8.0 to 29.8 GB |
So the generation column below is measured where the planner pays in full and collects almost nothing. The 128K anchors behind #9675 would have had 2.5 to 40 GB of cache genuinely live. A long-prompt re-run is in progress and I will post it here; treat the generation numbers as the short-sequence end of the range until then.
Two results are independent of this and hold at any sequence length: the cells where --fit on kept the model fully resident and the planner spilled anyway, and the multi-GPU result.
Both arms of every pair are verified to have seen the same free VRAM before loading. Cells whose allocation missed the target were recorded unmeasured and re-run, not measured off-target.
Figures are steady state, the median of the fastest half of samples. Heavily spilled models ramp over several requests as host-resident weights warm, and the two arms ramp at different rates; a raw median across the ramp reported 2.18x on one cell that settles at 1.10x.
Summary
| Cells where the planner produced a plan | 43 of 76 |
Prefill faster than --fit on |
0 of 43 (median 0.65x, range 0.20 to 0.90) |
Generation faster than --fit on |
3 of 43 (median 0.73x, range 0.12 to 1.99) |
| Two-GPU cells where it produced a plan | 0 of 13 |
| Non-planned cells (abstain or Studio fit) | 33, all between 0.93x and 1.16x |
Single GPU, planner engaged
Column key, used by every table below:
- A = the planner (
llama_extra_args: [], planner places the model) - B = the baseline (
llama_extra_args: ["--fit","on"], llama.cpp places it) - pp = prompt processing (prefill), tokens/s
- tg = token generation (decode), tokens/s
- pp and tg ratio columns are A / B. Above 1.00 means the planner is faster, below 1.00 means it is slower.
- blk = blocks spilled to host by the planner, out of the spillable total
Sorted by generation ratio, worst last.
| cell | free MiB | blk | A pp | B pp | pp A/B | A tg | B tg | tg A/B |
|---|---|---|---|---|---|---|---|---|
| Llama-3.3-70B Q4, Ada | 38016 | 38/80 | 267.3 | 309.1 | 0.86 | 15.27 | 7.68 | 1.99 |
| Qwen3.6-35B-A3B Q4, 3090 | 9344 | 37/40 | 118.1 | 132.5 | 0.89 | 15.66 | 12.31 | 1.27 |
| Llama-3.3-70B Q4, 3090 | 24448 | 73/80 | 46.7 | 57.4 | 0.81 | 6.56 | 5.96 | 1.10 |
| Qwen3.6-35B-A3B Q4, Ada | 16768 | 23/40 | 662.2 | 839.2 | 0.79 | 66.55 | 65.01 | 1.02 |
| Qwen3.8-27B Q4, 3090 | 14848 | 64/64 | 108.0 | 163.3 | 0.66 | 4.35 | 4.64 | 0.94 |
| Llama-3.3-70B Q4, Ada | 47360 | 17/80 | 445.6 | 507.7 | 0.88 | 34.28 | 38.65 | 0.89 |
| Qwen3.8-27B Q4, Ada | 14848 | 64/64 | 338.2 | 476.6 | 0.71 | 3.96 | 4.67 | 0.85 |
| Qwen3-32B Q4, 3090 | 24320 | 26/64 | 200.0 | 300.4 | 0.67 | 24.11 | 28.61 | 0.84 |
| Qwen3.8-27B Q4, 3090 | 18560 | 38/64 | 159.3 | 319.7 | 0.50 | 8.00 | 9.57 | 0.84 |
| Qwen3-32B Q4, 3090 | 24064 | 27/64 | 193.8 | 301.0 | 0.64 | 23.62 | 29.77 | 0.79 |
| GLM-4.7-Flash Q4, 3090 | 11008 | 39/46 | 132.2 | 178.0 | 0.74 | 20.88 | 26.60 | 0.78 |
| Qwen3.6-35B-A3B Q4, Ada | 9344 | 38/40 | 410.8 | 475.8 | 0.86 | 44.34 | 56.53 | 0.78 |
| Qwen3-32B Q4, Ada | 18560 | 55/64 | 371.8 | 525.2 | 0.71 | 20.60 | 26.72 | 0.77 |
| GLM-4.7-Flash Q4, Ada | 11008 | 40/46 | 470.4 | 645.1 | 0.73 | 63.33 | 83.41 | 0.76 |
| Qwen3.8-27B Q4, Ada | 18560 | 41/64 | 469.5 | 823.6 | 0.57 | 7.26 | 9.72 | 0.75 |
| Qwen3.6-35B-A3B Q4, 3090 | 16768 | 21/40 | 216.4 | 239.4 | 0.90 | 25.28 | 34.49 | 0.73 |
| Qwen3.6-35B-A3B Q4, Ada | 23296 | 8/40 | 1536.6 | 3142.7 | 0.49 | 121.26 | 165.49 | 0.73 |
| Qwen3.6-35B-A3B Q2, 3090 | 7168 | 39/40 | 197.2 | 237.5 | 0.83 | 19.76 | 28.24 | 0.70 |
| Llama-3.3-70B Q4, Ada | 25984 | 70/80 | 169.5 | 204.1 | 0.83 | 2.88 | 4.28 | 0.67 |
| Qwen3.6-35B-A3B Q2, Ada | 7168 | full | 650.9 | 816.1 | 0.80 | 53.09 | 84.43 | 0.63 |
| Qwen3-32B Q4, 3090 | 18560 | 53/64 | 111.0 | 166.0 | 0.67 | 11.92 | 20.99 | 0.57 |
| GLM-4.7-Flash Q4, Ada | 16768 | 23/46 | 781.1 | 1466.5 | 0.53 | 97.41 | 172.17 | 0.57 |
| Qwen3-32B Q4, Ada | 24064 | 30/64 | 587.8 | 826.0 | 0.71 | 45.01 | 82.96 | 0.54 |
| GLM-4.7-Flash Q4, 3090 | 16768 | 21/46 | 240.3 | 444.4 | 0.54 | 34.55 | 65.40 | 0.53 |
| Qwen3.6-35B-A3B Q2, 3090 | 11136 | 23/40 | 335.4 | 442.9 | 0.76 | 25.12 | 58.57 | 0.43 |
| Qwen3.6-35B-A3B Q4, 3090 | 23296 | 7/40 | 526.8 | 1257.3 | 0.42 | 54.04 | 133.04 | 0.41 |
| Qwen3.6-35B-A3B Q2, Ada | 11136 | 25/40 | 1028.0 | 1409.6 | 0.73 | 48.80 | 132.94 | 0.37 |
| Qwen3-32B Q4, Ada | 29440 | 7/64 | 1255.2 | 1743.5 | 0.72 | 94.57 | 318.62 | 0.30 |
| Qwen3.6-35B-A3B Q2, Ada | 14592 | 11/40 | 1695.0 | 4055.8 | 0.42 | 73.30 | 305.52 | 0.24 |
| Qwen3-8B Q4, 3090 | 11008 | 22/36 | 662.2 | 3348.3 | 0.20 | 84.28 | 447.67 | 0.19 |
| Qwen3-8B Q4, Ada | 11008 | 29/36 | 1818.2 | 6194.0 | 0.29 | 101.81 | 858.68 | 0.12 |
Medians per model
| model | size | cells | pp median | tg median | tg best |
|---|---|---|---|---|---|
| Llama-3.3-70B UD-Q4_K_XL | 39.7 GiB | 4 | 0.84 | 1.00 | 1.99 |
| Qwen3.6-35B-A3B UD-Q4_K_XL | 20.8 GiB | 6 | 0.82 | 0.76 | 1.27 |
| Qwen3-32B UD-Q4_K_XL | 18.6 GiB | 6 | 0.69 | 0.67 | 0.84 |
| GLM-4.7-Flash UD-Q4_K_XL | 16.3 GiB | 4 | 0.64 | 0.67 | 0.78 |
| Qwen3.8-27B UD-Q4_K_XL | 16.0 GiB | 4 | 0.61 | 0.84 | 0.94 |
| Qwen3.6-35B-A3B UD-Q2_K_XL | 11.4 GiB | 5 | 0.76 | 0.43 | 0.70 |
| Qwen3-8B Q4_K_M | 4.7 GiB | 2 | 0.24 | 0.15 | 0.19 |
Budget sweep, Qwen3.6-35B-A3B UD-Q4_K_XL on the Ada
256 MiB steps, to check whether the advantage is confined to a narrow band.
| free MiB | blk | A pp | B pp | pp A/B | A tg | B tg | tg A/B |
|---|---|---|---|---|---|---|---|
| 21504 | 12/40 | 1184.3 | 1820.0 | 0.65 | 80.86 | 168.98 | 0.48 |
| 21760 | 11/40 | 1256.2 | 1954.3 | 0.64 | 108.39 | 124.68 | 0.87 |
| 22016 | 11/40 | 1262.9 | 2160.1 | 0.58 | 108.90 | 133.57 | 0.82 |
| 22272 | 10/40 | 1325.9 | 2232.3 | 0.59 | 89.12 | 138.42 | 0.64 |
| 22528 | 9/40 | 1419.0 | 2504.4 | 0.57 | 121.13 | 147.97 | 0.82 |
| 22784 | 9/40 | 1410.7 | 2591.9 | 0.54 | 117.76 | 152.25 | 0.77 |
| 23040 | 8/40 | 1511.0 | 2906.1 | 0.52 | 127.61 | 163.45 | 0.78 |
| 23296 | 8/40 | 1529.9 | 3386.8 | 0.45 | 116.95 | 180.76 | 0.65 |
| 23552 | 7/40 | 1644.1 | 3525.4 | 0.47 | 138.39 | 180.82 | 0.77 |
| 23808 | 7/40 | 1656.8 | 4027.0 | 0.41 | 136.94 | 205.66 | 0.67 |
| 24064 | 6/40 | 1771.2 | 4582.4 | 0.39 | 151.61 | 234.34 | 0.65 |
| 24320 | 6/40 | 1785.9 | 5264.2 | 0.34 | 152.35 | 262.12 | 0.58 |
| 24576 | fits | 5393.4 | 5303.8 | 1.02 | 254.60 | 261.48 | 0.97 |
12 of 12 planned points lose on both metrics. No cliff in the band.
Two GPUs
All 13 cells, all 7 models. None produced a plan. Six were targeted at budgets where the offline planner emits a full spill at that exact figure.
| cell | free MiB/dev | branch | pp A/B | tg A/B |
|---|---|---|---|---|
| Llama-3.3-70B, plan target | 13888 | abstained | 0.97 | 1.03 |
| Llama-3.3-70B, abstain point | 16384 | abstained | 0.98 | 0.97 |
| Qwen3-32B, plan target | 11072 | abstained | 1.02 | 0.99 |
| Qwen3-32B, abstain point | 13376 | abstained | 1.00 | 1.04 |
| Qwen3.6-35B-A3B, plan target | 6016 | abstained | 1.03 | 1.05 |
| Qwen3.6-35B-A3B, abstain point | 11776 | abstained | 0.96 | 0.98 |
| Qwen3.6-35B-A3B Q2, plan target | 5184 | abstained | 1.06 | 0.99 |
| Qwen3.6-35B-A3B Q2, abstain point | 9088 | studio fit | 0.99 | 1.00 |
| GLM-4.7-Flash, plan target | 7104 | abstained | 1.00 | 0.93 |
| GLM-4.7-Flash, abstain point | 11328 | abstained | 1.00 | 1.01 |
| Qwen3.8-27B, abstain point | 11648 | abstained | 1.02 | 0.98 |
| Qwen3-8B, plan target | 7616 | studio fit | 0.99 | 0.99 |
| Qwen3-8B, abstain point | 8640 | studio fit | 1.00 | 0.98 |
Sweeping 368 budgets per model offline, the number that yield a plan on two devices: 5 for Qwen3.6-35B-A3B, 3 for Llama-3.3-70B, 2 for Qwen3-32B, 2 for the Q2 variant, 1 for Qwen3-8B, and 0 at any budget for Qwen3.8-27B.
Cells where the planner never ran
33 of 76. In 22 of them Studio's own fit succeeded first, so the planner was not consulted. This includes most cells sized for a light spill: by the time the budget is loose enough that only a few blocks would move, the gate in front of the planner already reports a fit. All 33 sit between 0.93x and 1.16x, so declining costs nothing.
Two cells where it spilled into headroom that was there
Both symmetric pairs, identical free VRAM in each arm.
| cell | arm | card used | spilled | tg |
|---|---|---|---|---|
| Qwen3.6-35B-A3B Q2, Ada, 14033 MiB free | planner | 44821 MiB | 3.2 GB | 73.3 |
--fit on |
47279 MiB | none | 305.5 | |
| Qwen3-32B, 3090, 23606 MiB free | planner | 21446 MiB | 6.8 GB | 24.1 |
--fit on |
22892 MiB | none | 28.6 |
llama.cpp kept 1.4 to 2.5 GB more resident than the planner treated as available.
Interpretation
The mechanism works where the cache is worth protecting. Llama-3.3-70B on the Ada at 38016 MiB free is the clearest case: the planner keeps the cache resident and decodes at 15.3 t/s while --fit on moves whole layers and their cache to host and gets 7.7 t/s. Seven samples per arm, arm B flat with no ramp.
Outside that, on this host, the weights it moves cost more than the cache it saves. Prefill pays in every planned cell without exception, because prefill streams the spilled weights. Generation pays in 40 of 43. The three wins are all large models deep into overflow, not the small-budget MoE case the description predicts 3.08x for.
Three things look separable from the idea itself:
- The cost model already receives the host thread count (
HostProfile(threads=os.cpu_count()),REFERENCE_HOST_THREADS = 192), so it is not blind to a 12-thread host. It is mispredicting with the information it has rather than lacking it. - Near the fit boundary it is 1.4 to 2.5 GB more conservative than llama.cpp, and that is where its worst losses are.
- The two-device path produced no plan in 13 live cells and has no planning window at all for one of the seven models.
On the evidence here I would put UNSLOTH_SMART_OFFLOAD back to opt-in until the gate only fires where it wins. The 33 cells where the planner declined all sat within noise of --fit on, so narrowing it costs nothing measurable.
This is one host, and the term that hurts most here is the one it has least of: spilled decode runs on the CPU backend, and 6 cores against the 192-core reference is the adversarial end of the range. "Slower on a consumer desktop" is what these numbers establish. "Slower in general" is not.
Happy to re-run any cell, sweep a different band, or share the raw per-request timings.
Activity
danielhanchen commentedon Aug 27, 2026
Thanks for this. The method is careful in the places that usually make this kind of comparison useless: same running backend for both arms, verified equal free VRAM per pair, fixed prompt so the drafter's acceptance matches, and steady state rather than a median across the ramp. I checked the falsifiable parts against current main rather than taking the numbers on trust, and the report holds up.
There is a mechanism behind your prefill row, and it is not host size.
rankinoffload_cost_model.pyscores a placement as prefill plus generation:offload_planner.pyimports onlygeneration_penalty_ms(line 34) and calls it in exactly one place (line 227).rankandprefill_penalty_ms_per_tokenhave no callers. The planner optimises decode alone and spends prefill it never counted. That is why prefill is slower in 43 of 43 planned cells with no exception, and why the sweep shows no cliff: nothing in the decision has a prefill term to have a cliff in.On your three separable points:
HostProfile(threads = os.cpu_count() or 1),llama_cpp.py:25105), and the model already takes the more pessimistic of its two Amdahl fits, about 3.9x at 12 threads against the 192-thread reference. It mispredicts with the information it has. Your framing was right.offload_planner.py:658, not a missing window. A pooled budget cannot prove a per-device fit when llama.cpp assigns contiguous layer ranges before-otexists, so it declines and lets the fitter place it. Your own data supports leaving that alone: all 13 cells sat between 0.93x and 1.16x.I have taken your recommendation. #9862 puts
UNSLOTH_SMART_OFFLOADback to opt-in. Pricing prefill is the real fix and I would rather do it as its own change than fold it into the default flip.One thing I want to restate rather than let it get lost, since it is your caveat and not mine: this is one host, and 6 cores against a 192-core reference is the adversarial end. What your data establishes is that the shipped default was calibrated on a regime that excluded consumer desktops, and that the fallback costs nothing measurable there. That is enough to justify the default going back.
The 70B-on-Ada cell at 38016 MiB is the one I would not want to lose track of: 1.99x on generation with seven samples and a flat baseline arm is the mechanism working exactly as intended. The gate needs to fire there and not in the other 40.
If you are willing, the per-request timings for the two headroom cells would be useful, where llama.cpp kept 1.4 to 2.5 GB more resident than the planner treated as available.
oobabooga commentedon Aug 27, 2026
Checked the
rankpoint againstmainbefore replying, since it is the part that would change how I read my own prefill column. It holds:prefill_penalty_ms_per_tokenhas exactly one caller,rankitself atoffload_cost_model.py:269, andrankhas no production callers anywhere in the backend. The planner importsgeneration_penalty_msand calls it once, atoffload_planner.py:227. So the objective has no prefill term to trade against. That is a better explanation than the one I gave: I had the cost right, streaming spilled weights over PCIe, but not the reason the planner never weighs it.On the two-device abstain, you are right and I was not. I described it as a path that never fires; it is a deliberate decline where a pooled budget cannot prove a per-device fit, and my own numbers say declining is free. Withdrawing that framing.
Per-request timings, the two headroom cells
Both arms saw identical free VRAM.
n_ctx32768, 4 slots, 2318 to 2320 token prompt, 128 tokens generated, temperature 0, 3 requests per arm after a discarded warm-up.Qwen3-32B UD-Q4_K_XL, RTX 6000 Ada, 28881 MiB free, ballast 18400 MiB
--fit on^blk\.(0|1|3|6|43|62|63)\.ffn_(up|gate|down)\.weight$, 24.4 GB resident, 2.3 GB hostAcceptance is identical and saturated in both arms, so the 3.3x generation gap here is placement and nothing else.
Qwen3.6-35B-A3B UD-Q2_K_XL, RTX 6000 Ada, 14033 MiB free, ballast 33248 MiB
--fit on^blk\.(0|1|2|3|4|5|6|7|34|38|39)\.ffn_(up|gate|down|gate_up)_(exps|chexps)\.weight$, 9.2 GB resident, 3.2 GB hostThis one needs a caveat I would rather raise myself than have you find. The draft counts differ between arms, 224 drafted with 94 accepted against 125 drafted with 98 accepted, so the two arms did not decode the same tokens despite the same fixed prompt and temperature 0. The likely cause is that moving expert tensors to the CPU changes the numerics enough to diverge the sampled token, after which the MTP head is working on different text. Some part of that 4.3x is therefore drafter efficiency rather than placement. The Qwen3-32B cell above has no such problem and is the cleaner of the two for the headroom argument.
It also puts a floor on how identical two arms of this comparison can be made: any A/B on this feature that relies on matched decoding will diverge on some models, and the fixed-prompt control only holds where the sampled path happens not to.
Long-prompt re-run
The generation column in the report is measured at about 2.2K live tokens against an
n_ctxof 32768, so the cache the planner is protecting is nearly empty while the weights it moves are read every token. That biases the whole generation column against the planner, and it is my error, not a property of the algorithm.Re-running a subset at a 27569 token prompt, same ballast and same
n_ctx, so the placement decision is identical and only the workload changes. I will post it here when it finishes.The first cell is the control, Qwen3-8B on the Ada at 11008 MiB free, where the model fits and
--fit onkeeps it fully resident. Generation went from 0.12x to 0.15x. That cell should not improve with a fuller cache and did not, which is the result I would expect if the spill-a-model-that-fits cases are a budget question rather than a workload one.danielhanchen commentedon Aug 27, 2026
Following up on my own comment, because you added the request-shape section after I read the issue and it changes what I should be leaning on.
You are right to flag it, and it cuts at our evidence harder than at yours. The Colab matrix behind #9779 ran the bench notebooks at
ctx=4096, npred=16, depth=0.depth=0is an empty KV cache. Only one wave ever setBENCH_DEPTH=32768, and that was an OOM-debugging run on a single model. So the cache-retention benefit this planner exists to buy was not really measured on our side either. Your 2.2K live is thin, but it is not zero.I have rewritten the #9862 description to stop resting on the generation column. What it rests on now is what I found reading the planner rather than anything in your tables, and it is a bigger problem than the one you reported:
The cost model does not gate the decision at all. Every abstain in
offload_planner.pyis a feasibility abstain -- layout incomplete, unified memory, no creditable VRAM, no usable context, per-device shortfall, multi-device partial spill. There is no cost-based abstain anywhere. If a spill covers the deficit it is taken._spill_penalty_msis computed once at line 838 intoPlan.predicted_gen_penalty_ms, and nothing but tests ever reads that field.rank()andprefill_penalty_ms_per_tokenhave no callers at all.So the planner never asks whether spilling beats
--fit on. That explains your prefill row without needing the host to be small, and it explains your two fully-resident cells directly, which are the ones you correctly note hold at any sequence length.The depth sweep is the experiment neither of us has run, so I am going to run it on the same harness:
-dacross 0, 4096, 16384, 32768 at fixed context, both arms. If the trade only pays above some live depth, that belongs in the gate as a condition rather than in the default. I will post the numbers here whichever way they land.No need to rush the long-prompt re-run on my account, though I would still like to see it. The two sequence-length-independent results plus the missing gate are already enough to justify the flag going back to opt-in.
oobabooga commentedon Aug 27, 2026
Ran the depth sweep on the 6-core desktop, so it sits alongside whatever the Colab-class run shows rather than duplicating it.
Method
Neither arm consults the planner. Arm A replays a placement verbatim through passthrough args, using the exact
-otpattern the planner chose for that cell before #9863, and arm B is--fit on. That makes the result a property of the trade rather than of the election rule, so it survives #9862, #9863 and whatever the gate becomes.Depth is the live sequence length, set by prompt size at a fixed
n_ctxof 32768. Ballast, placement andn_ctxare identical at every depth, so only the workload moves. 3 requests per arm after a discarded warm-up, steady state.Llama-3.3-70B UD-Q4_K_XL, Ada, 38016 MiB free, 38 of 80 blocks spilled
--fit ont/sQwen3.6-35B-A3B UD-Q4_K_XL, 3090, 16768 MiB free, 21 of 40 blocks spilled
--fit ont/sWhat the two curves say
The 70B has a crossover, somewhere between 84 and about 4K live tokens, and the advantage keeps growing to 5.15x at 29.5K. The mechanism is visible in the baseline column rather than the spill column:
--fit ongoes 33.03, 10.51, 4.87 as depth grows, at a stable draft acceptance of about 100%, which is what a host-resident KV cache looks like. The spill arm does not degrade that way because its cache stays on the card.The MoE has no crossover at any depth. 0.75, 0.74, 0.74, 0.73 is flat across a 300-fold change in live tokens, and here draft acceptance is identical between the arms at every depth (78/125, 105/128, 100/125, 100/125), so this one is about as clean as the harness gets. For this cell
--fit onis not putting the cache on host, so there is nothing for the spill to buy, and it just pays for host-resident weights.So the discriminator is not depth alone and it is not "does the model fit". It is whether the placement
--fit onwould otherwise choose puts the cache on host, with depth setting how much that costs. A gate keyed on depth alone would fire on the MoE cell, where spilling loses at every depth tested.Prefill never benefits in either model, which is consistent with the objective having no prefill term.
One point excluded
The 70B at 16190 live tokens read 0.88 and I am leaving it out rather than reporting it as a fourth point. Draft acceptance collapsed in both arms there (86/115, 72/122, 72/117 for the spill arm; 53/64, 70/115, 117/117 for the baseline) against roughly 100% at every other depth. Different depths use different prompts, so the fixed-prompt control holds acceptance constant within a cell but not across depths.
The cleaner design for a depth sweep is to disable speculative decoding for the duration, which removes acceptance as a variable entirely. I did not do that here because the placements I wanted to replay were measured with the drafter active. Worth doing if this sweep is going to inform the gate condition.
Status of the other threads
The #9863 numbers are on that PR. Short version: with the planner actually enabled, it spills 0.8 to 1.1 GB less in all five cells and improves every ratio, does not lift any of the four regressions above parity, and preserves the 70B win at 1.89x. Roughly half the headroom gap remains after it.
oobabooga commentedon Aug 27, 2026
Adding the exact inputs for the depth sweep, since the previous comment described the forced arm without giving it.
Arm A, Llama-3.3-70B UD-Q4_K_XL on the Ada, target 38016 MiB free:
Arm A, Qwen3.6-35B-A3B UD-Q4_K_XL on the 3090, target 16768 MiB free:
Both are what the planner itself emitted for those cells before #9863. Arm B is
llama_extra_args: ["--fit","on"]in every case. Both go throughPOST /api/inference/loadwithgpu_memory_mode: auto,force_reload: true,max_seq_length: 32768, andgpu_idsset to the single card.Free VRAM is set by a separate process holding a plain allocation on the target card until the card reports the target figure, checked before each load and re-derived from live free VRAM rather than a fixed number. Both arms of a pair are asserted to have seen the same free VRAM before loading; pairs that miss the target are discarded rather than measured.
Depth is the live sequence length, produced by repeating a fixed 294-character paragraph to the required token count and appending one instruction line. Prefill is measured with a unique prefix per request so the prompt cache cannot serve it, with 8 output tokens. Generation is measured with one fixed prompt reused across requests, 128 output tokens, temperature 0, so both arms decode the same tokens. Throughput comes from llama-server's
timingson the final SSE chunk, withstream_options.include_usageset. Reported figures are the median of the fastest half of the samples, which drops the warm-up ramp that otherwise dominates a median on heavily spilled models.Depth points were 1, 71, 283 and 517 paragraphs, giving 84 to 97, about 4100, about 16200 and about 29500 live tokens depending on tokenizer.
danielhanchen commentedon Aug 27, 2026
I ran the measurement neither of us had: a depth sweep with the fallback arm actually being
--fit on. Two of your claims hold, one of mine did not, and the headline turns out to be a flag rather than the planner.First, my own evidence was broken
Before any of this is worth quoting, two defects in our benchmark harness, both of which flattered the planner:
-nglwas off by one. It capped at the block count, but-nglcounts the repeating blocks plus the non-repeating output tensor, so ~1008 MiB ofoutput.weightsat on the host in every baseline cell. On a card where the planner spilled nothing, and both arms therefore had to be identical, this alone read as a 1.78x prefill win. This was present in the matrix behind Studio: turn the offload planner on by default #9779 that justified turning the default on.--fit on.llama-benchhas its own parser and no--fitflag at all, so what we called the fallback was a hand-rolled-nglspill that comes backkv_on_gpu: falsein every cell.The corrected arm starts
llama-server --fit on -lv 10, reads the fitter's own placement out of its trace, rebuilds its-otpatterns and replays them inllama-benchon the same timer, then checks the replay's host bytes against what the server allocated and refuses to report a number if they disagree. Three separate spelling mistakes were caught by that check.--fit onbranches on architectureFrom
common/fit.cppand confirmed by measurement:n_gpu_layers54/65 and 38/65,n_part=0.blk.<il>.ffn_(up|down|gate_up|gate)_(ch|)exps(fit.cpp:434-440), so the cache stays resident.n_partwas 14, 23 and 31 on a 16 GiB A100, 12 GiB L4 and 8 GiB T4, against 13, 22 and 31 spilled blocks for the planner. On MoE the two place the model almost identically.The headline is
--load-mode none, not the plannerThe planner emits
--load-mode nonewhenever host RAM can hold the spill; the fallback path never does, and mmap costs 2 to 4.6x on host-resident weight reads. Giving--fit onthe same flag and changing nothing else, on an L4:--load-mode noneThat flag accounts for 2.09x to 2.35x of the planner's prefill lead. Once it is equalised the planner is 0.88x on MoE prefill, i.e. worse. This looks like the largest single win available here and it needs no planner at all, so it is worth considering on the fallback path directly. It has to be conditional on host RAM: on a 12.67 GiB box the no-mmap arm could not run at all.
Where the planner does earn its keep
Generation on dense models, and the advantage grows with live context, which is the regime your caveat correctly identified as unmeasured.
kv_on_gpuis True for the planner and False for the fitter on every dense cell:--fit onMonotonic on dense across four depths and two independent cards, flat on MoE, 1.00x on the control. Equalising the flag barely moves the generation column (1.18x to 1.23x at d=0, 1.71x to 1.75x at 16384), so that column is close to the planner's real contribution.
Your 6-core desktop is the case where it is actively harmful
On a 12.67 GiB host the planner ran at 0.31x and 0.23x of
--fit onon generation, and its dense placement failed to load at all, twice, reproducibly:--fit oncompleted both times on the same box. That host is also the one where--load-mode noneis unavailable, so the planner has no advantage left to trade. Depth made it worse, not better: 0.31x at depth 0 and 0.23x at 4096. Past 4096 the tier is not benchmarkable at all (about 68 minutes per arm), so I stopped rather than pad the table.What has changed
UNSLOTH_SMART_OFFLOADback to opt-in.Thanks for the report, and in particular for editing in the live-sequence-length caveat. That caveat is what sent me looking at depth, and it is the axis the whole picture turns on.
danielhanchen commentedon Sep 1, 2026
This should be fixed now - sorry on the delay - please update Unsloth Studio to the latest via
curl -fsSL https://unsloth.ai/install.sh | shfor Linux, Mac, WSL orirm https://unsloth.ai/install.ps1 | iexfor Windows - if it's not fixed yet, it'll be in the next Studio release - if it's still not working after that, please open another issue - appreciate it again!Studio offload: the default-off docstring says both gates price prefi…