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(coli): --gpu on DeepSeek V4 refused an install with only the DeepGEMM DLL

kevin9327f13f46007a79
diff --git a/c/coli b/c/coli
index 0d84debf..23a0e06e 100755
--- a/c/coli
+++ b/c/coli
@@ -615,8 +615,11 @@ def dsv4_cuda_available(model=None):
# not make a CPU engine look GPU-capable.
eng = engine_for(model) if model else GLM
if sys.platform == "win32":
- dll = os.path.join(os.path.dirname(eng), "coli_cuda_dsv4.dll")
- return os.path.exists(dll)
+ # backend_loader_dsv4.c tries the DeepGEMM build first and the generic
+ # one second, so either next to the engine starts the tier (the same
+ # two names `coli doctor` accepts).
+ return any(os.path.exists(os.path.join(os.path.dirname(eng), name))
+ for name in ("coli_cuda_dsv4_dg.dll", "coli_cuda_dsv4.dll"))
if sys.platform == "linux" and os.path.exists(eng):
try:
linked = subprocess.run(["ldd", eng], capture_output=True, text=True, timeout=3)
diff --git a/c/tests/test_env_defaults.py b/c/tests/test_env_defaults.py
index 4692b5d0..6434abef 100644
--- a/c/tests/test_env_defaults.py
+++ b/c/tests/test_env_defaults.py
@@ -303,14 +303,14 @@ class Dsv4CudaDetectTest(unittest.TestCase):
probe there rejected every valid `make deepseek-v4 CUDA=1` build (#1219)."""
def _detect(self, platform, ldd_stdout=None, dll=False, engine_exists=True,
- ldd_error=None):
+ ldd_error=None, dll_name="coli_cuda_dsv4.dll"):
tmp = tempfile.TemporaryDirectory()
self.addCleanup(tmp.cleanup)
eng = Path(tmp.name) / "deepseek"
if engine_exists:
eng.write_bytes(b"")
if dll:
- (Path(tmp.name) / "coli_cuda_dsv4.dll").write_bytes(b"")
+ (Path(tmp.name) / dll_name).write_bytes(b"")
fake_run = mock.Mock(return_value=types.SimpleNamespace(stdout=ldd_stdout or ""),
side_effect=ldd_error)
with mock.patch.object(sys, "platform", platform), \
@@ -350,6 +350,16 @@ class Dsv4CudaDetectTest(unittest.TestCase):
def test_win32_dll_detected(self):
self.assertTrue(self._detect("win32", dll=True))
+ def test_win32_deepgemm_dll_alone_detected(self):
+ # backend_loader_dsv4.c tries coli_cuda_dsv4_dg.dll first and
+ # coli_cuda_dsv4.dll second, and `coli doctor` accepts either. --gpu
+ # refused an install that had only the DeepGEMM build next to it.
+ self.assertTrue(self._detect("win32", dll=True,
+ dll_name="coli_cuda_dsv4_dg.dll"))
+
+ def test_win32_unrelated_dll_rejected(self):
+ self.assertFalse(self._detect("win32", dll=True, dll_name="coli_cuda.dll"))
+
def test_win32_missing_dll_rejected(self):
self.assertFalse(self._detect("win32", dll=False))