Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

fix(doctor): omit GPU plan for CPU-only engine

Mauricio Sevilla Britto700151dc9bca
diff --git a/c/doctor.py b/c/doctor.py
index 57317ee9..3bdc8c82 100644
--- a/c/doctor.py
+++ b/c/doctor.py
@@ -540,9 +540,17 @@ def run_doctor(model, ram_gb=0, context=4096, gpu_indices=None, vram_gb=0, *,
try:
if resolved is None:
raise ValueError("placement requires a registered model family")
- plan = build_plan(model, ram_gb, context, gpu_indices, vram_gb,
+ # The placement report describes this installed engine, not merely the
+ # hardware visible on the host. A CPU-only binary cannot spend VRAM;
+ # passing discovered GPUs through here made doctor contradict its own
+ # accelerator check and emit CUDA-only tuning advice. Keep inventory
+ # details in accelerator.gpu above, but build an executable plan below.
+ plan_gpus = detected_gpus if linkage.get("linked") else []
+ plan_gpu_indices = gpu_indices if linkage.get("linked") else []
+ plan_vram_gb = vram_gb if linkage.get("linked") else 0
+ plan = build_plan(model, ram_gb, context, plan_gpu_indices, plan_vram_gb,
available_memory=available_memory, available_disk=available_disk,
- gpus=detected_gpus, kv_slots=kv_slots)
+ gpus=plan_gpus, kv_slots=kv_slots)
model_info = plan["model"]
checks.append(_check("model.shards", "pass", "safetensors headers are valid",
shards=model_info["shards"], model_bytes=model_info["model_bytes"]))
diff --git a/c/tests/test_doctor.py b/c/tests/test_doctor.py
index e01692c0..c1ce4273 100644
--- a/c/tests/test_doctor.py
+++ b/c/tests/test_doctor.py
@@ -138,13 +138,30 @@ class DoctorTest(unittest.TestCase):
def test_cpu_engine_with_detected_gpu_is_only_a_warning(self):
gpu = {"index": 0, "name": "fixture", "total_bytes": 12 * GB,
"free_bytes": 10 * GB}
- report = self.report(gpu_indices=None, gpus=[gpu])
+ report = self.report(gpu_indices=[0], vram_gb=8, gpus=[gpu])
check = self.checks_by_id(report)["accelerator.gpu"]
self.assertEqual(check["status"], "warn")
+ self.assertEqual(report["plan"]["tiers"]["vram"]["devices"], [])
+ self.assertEqual(report["plan"]["tiers"]["vram"]["budget_bytes"], 0)
+ self.assertEqual(report["plan"]["warnings"], [])
+ self.assertNotIn("COLI_CUDA_PIPE", report["plan"]["tune"])
+ self.assertNotIn("GPU", report["plan"]["expected_bottleneck"])
self.assertEqual(report["status"], "warning")
self.assertEqual(exit_code(report), 0)
+ def test_gpu_engine_with_detected_gpu_keeps_vram_plan(self):
+ gpu = {"index": 0, "name": "fixture", "total_bytes": 12 * GB,
+ "free_bytes": 10 * GB}
+ report = self.report(gpu_indices=None, gpus=[gpu],
+ linkage={"linked": True, "missing": False})
+
+ self.assertGreater(report["plan"]["tiers"]["vram"]["budget_bytes"], 0)
+ self.assertEqual(report["plan"]["tiers"]["vram"]["devices"], [
+ {**gpu, "reserve_bytes": 2 * GB, "usable_bytes": 8 * GB},
+ ])
+ self.assertIn("COLI_CUDA_PIPE", report["plan"]["tune"])
+
def test_gpu_check_uses_backend_neutral_identifier(self):
gpu = {"index": 0, "name": "Intel Arc B570", "total_bytes": 10 * GB,
"free_bytes": 9 * GB}