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(tests): update the cuda-test OpenMP build contract to match (#971)

Unknown-Findout87d960c67841
diff --git a/c/Makefile b/c/Makefile
index b727cc9e..b4b0af11 100644
--- a/c/Makefile
+++ b/c/Makefile
@@ -889,7 +889,13 @@ cuda-test: backend_cuda.cu backend_cuda.h backend_gpu_compat.h tests/test_backen
# link step) and MSVC, whose OpenMP predates C99 loop declarations in C mode.
# It was also the only reason the final nvcc/hipcc link here had to drag in
# the host OpenMP runtime, so GPU_OMP_LINK goes with it.
- $(CC) $(CFLAGS) -fno-openmp -c tests/mxfp4_ref.c -o tests/mxfp4_ref.o
+ # The OpenMP flags are FILTERED OUT rather than overridden with -fno-openmp
+ # alone: on macOS they arrive as `-Xclang -fopenmp`, which goes straight to
+ # the frontend and is not necessarily undone by a driver-level -fno-openmp.
+ # Getting that wrong would leave OpenMP symbols in the object while the link
+ # below no longer pulls the runtime, and CI could not catch it because CI
+ # never runs cuda-test. -Xclang appears nowhere else in CFLAGS.
+ $(CC) $(filter-out -Xclang -fopenmp,$(CFLAGS)) -fno-openmp -c tests/mxfp4_ref.c -o tests/mxfp4_ref.o
"$(GPUCC)" $(GPUFLAGS) backend_cuda.cu tests/test_mxfp4_cuda.cu tests/mxfp4_ref.o -o mxfp4_cuda_test$(EXE)
./mxfp4_cuda_test$(EXE)
diff --git a/c/tests/test_cuda_test_makefile.py b/c/tests/test_cuda_test_makefile.py
index 9ccaec01..9abf054e 100644
--- a/c/tests/test_cuda_test_makefile.py
+++ b/c/tests/test_cuda_test_makefile.py
@@ -22,18 +22,36 @@ def mxfp4_link_line(recipe):
"")
+def mxfp4_ref_compile_line(recipe):
+ return next(
+ (line for line in recipe.splitlines()
+ if "tests/mxfp4_ref.c" in line and " -c " in line),
+ "")
+
+
class CudaTestMakefileTest(unittest.TestCase):
- def test_nvcc_links_the_cpu_oracle_openmp_runtime(self):
+ # These three replace the pair that asserted the OpenMP runtime WAS linked.
+ # The CPU oracle is now built without OpenMP (#971), because that single
+ # dependency broke `make cuda-test` on a host with no libgomp - the link
+ # died on undefined reference to GOMP_parallel, out of mxfp4_ref.o. The
+ # oracle's largest case is S=4 I=2048 O=64, so nothing measurable was lost.
+ def test_cpu_oracle_is_compiled_without_openmp(self):
+ """The load-bearing assertion: re-adding OpenMP here would silently
+ reintroduce the link dependency that made the suite unbuildable."""
+ line = mxfp4_ref_compile_line(cuda_test_recipe("CUDA=1", "NVCC=nvcc"))
+ self.assertTrue(line, "no MXFP4 oracle compile command in dry-run recipe")
+ self.assertIn("-fno-openmp", line)
+
+ def test_nvcc_does_not_link_an_openmp_runtime_for_the_oracle(self):
line = mxfp4_link_line(cuda_test_recipe("CUDA=1", "NVCC=nvcc"))
self.assertTrue(line, "no MXFP4 CUDA link command in dry-run recipe")
- self.assertIn("-Xcompiler=-fopenmp", line)
+ self.assertNotIn("-fopenmp", line)
- def test_hipcc_links_the_cpu_oracle_openmp_runtime(self):
+ def test_hipcc_does_not_link_an_openmp_runtime_for_the_oracle(self):
line = mxfp4_link_line(cuda_test_recipe(
"HIP=1", "HIP_ARCH=gfx1100", "HIPCC=hipcc"))
self.assertTrue(line, "no MXFP4 HIP link command in dry-run recipe")
- self.assertIn("-fopenmp", line)
- self.assertNotIn("-Xcompiler=-fopenmp", line)
+ self.assertNotIn("-fopenmp", line)
def test_setup_openmp_probe_does_not_require_tmp(self):
setup = (HERE / "setup.sh").read_text(encoding="utf-8")