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

test(cuda): pin NVCC_ALLOW_UNSUPPORTED off by default and non-destructive

Unknown-Findoutafb077271958
diff --git a/c/tests/test_cuda_test_makefile.py b/c/tests/test_cuda_test_makefile.py
index 9abf054e..a79a96a4 100644
--- a/c/tests/test_cuda_test_makefile.py
+++ b/c/tests/test_cuda_test_makefile.py
@@ -15,6 +15,15 @@ def cuda_test_recipe(*variables):
return result.stdout + result.stderr
+def nvcc_compile_line(recipe):
+ """First real nvcc invocation, skipping the `command -v "nvcc"` guard line
+ that a naive grep for "nvcc" matches first."""
+ return next(
+ (line for line in recipe.splitlines()
+ if "backend_cuda.cu" in line and " -o " in line and "command -v" not in line),
+ "")
+
+
def mxfp4_link_line(recipe):
return next(
(line for line in recipe.splitlines()
@@ -53,6 +62,36 @@ class CudaTestMakefileTest(unittest.TestCase):
self.assertTrue(line, "no MXFP4 HIP link command in dry-run recipe")
self.assertNotIn("-fopenmp", line)
+ def test_allow_unsupported_compiler_is_off_by_default(self):
+ """nvcc's own wording for this flag is "may cause compilation failure or
+ incorrect run time execution", so it is never a default."""
+ line = nvcc_compile_line(cuda_test_recipe("CUDA=1", "NVCC=nvcc"))
+ self.assertTrue(line, "no nvcc compile command in dry-run recipe")
+ self.assertNotIn("-allow-unsupported-compiler", line)
+
+ def test_allow_unsupported_compiler_is_reachable(self):
+ """CUDA 13.1's host_config.h rejects any MSVC newer than VS2022, which
+ fails every nvcc target at the first #include with C1189. Before this
+ variable the only handle was NVCCFLAGS, and overriding that wholesale
+ drops the gencode, the -ccbin and the platform warning form."""
+ line = nvcc_compile_line(
+ cuda_test_recipe("CUDA=1", "NVCC=nvcc", "NVCC_ALLOW_UNSUPPORTED=1"))
+ self.assertTrue(line, "no nvcc compile command in dry-run recipe")
+ self.assertIn("-allow-unsupported-compiler", line)
+
+ def test_allow_unsupported_compiler_preserves_the_other_flags(self):
+ """The load-bearing one. Appending must not do what a wholesale
+ NVCCFLAGS override does, which is silently drop the arch and lose
+ -ftz=false -- and -ftz is a correctness flag here, not a tuning knob:
+ the fmt=8 kernels are cross-tier parity instruments and a flushed
+ subnormal diverges from the CPU reference."""
+ line = nvcc_compile_line(
+ cuda_test_recipe("CUDA=1", "NVCC=nvcc", "CUDA_ARCH=sm_86",
+ "NVCC_ALLOW_UNSUPPORTED=1"))
+ self.assertTrue(line, "no nvcc compile command in dry-run recipe")
+ for flag in ("-ftz=false", "-std=c++17", "sm_86"):
+ self.assertIn(flag, line, f"{flag} lost when the override is set")
+
def test_setup_openmp_probe_does_not_require_tmp(self):
setup = (HERE / "setup.sh").read_text(encoding="utf-8")
self.assertNotIn("/tmp/_omp", setup)