Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Count the context ceiling's per-device reserve gate from #14492 in the compute buffer wiring test (#14560)

Daniel Han35b4cf4dddc5
diff --git a/studio/backend/tests/test_compute_buffer.py b/studio/backend/tests/test_compute_buffer.py
index 439f9807b65..a8008f0bfe2 100644
--- a/studio/backend/tests/test_compute_buffer.py
+++ b/studio/backend/tests/test_compute_buffer.py
@@ -1166,20 +1166,23 @@ class TestPerDeviceSplitReserve:
import inspect
compact = "".join(inspect.getsource(LlamaCppBackend.load_model).split())
- # Native-context loop, the reduced-to-4096 fallback below it, and the
- # Auto drafter-drop probe above them, which caps to the same reserve so
- # it cannot price a drafter at a context the weakest card never holds.
- assert compact.count("ifnotself._every_gpu_holds_reserve(") == 3
+ # Native-context loop, the reduced-to-4096 fallback below it, the Auto
+ # drafter-drop probe above them, which caps to the same reserve so it cannot
+ # price a drafter at a context the weakest card never holds, and (#14492)
+ # the context ceiling's dGPU-only tier, where pooling can hide a small card.
+ assert compact.count("ifnotself._every_gpu_holds_reserve(") == 4
+ assert "_usable_mib=[_gpu_usable(g,_cap_fraction)forginsubset]" in compact
# Gated on the chosen context, and only reachable after the pooled test.
assert "_usable_mib=[_gpu_usable(g,pin_fraction)forginsubset]" in compact
assert "(_gpu_usable(g,pin_fraction)forginsubset)," in compact
assert "+_cc_bytes(c,n)//n)" in compact
assert "+_cc_bytes(effective_ctx,n_gpus)//n_gpus," in compact
- # The cap runs only on gate failure, and the pooled price is redone after it.
+ # The cap runs only on gate failure, and the pooled price is redone after it
+ # (the walk's body is a helper since #14492, so a rejected subset returns None).
assert (
compact.count(
"capped=self._cap_ctx_to_per_device_reserve("
- "capped,_usable_mib,_reserve_at)ifcapped<=0:continue"
+ "capped,_usable_mib,_reserve_at)ifcapped<=0:returnNone"
)
== 1
)