{"record":{"id":"fc49230bcae012a7","repo":"sgl-project/sglang","slug":"cannot-find-cutlass-headers-required-for-jit-compi","errorCode":null,"errorMessage":"Cannot find CUTLASS headers required for JIT compilation. Please install flashinfer or deep_gemm with CUTLASS headers.","messagePattern":"Cannot find CUTLASS headers required for JIT compilation\\. Please install flashinfer or deep_gemm with CUTLASS headers\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/kernels/jit/utils/deps.py","lineNumber":137,"sourceCode":"                include_paths.append(str(path))\n\n    deep_gemm_root = _find_package_root(\"deep_gemm\")\n    if deep_gemm_root is not None:\n        candidate = deep_gemm_root / \"include\"\n        if candidate.exists():\n            include_paths.append(str(candidate))\n\n    # De-duplicate while preserving order.\n    unique_paths = []\n    seen = set()\n    for path in include_paths:\n        if path in seen:\n            continue\n        seen.add(path)\n        unique_paths.append(path)\n\n    if not unique_paths:\n        raise RuntimeError(\n            \"Cannot find CUTLASS headers required for JIT compilation. \"\n            \"Please install flashinfer or deep_gemm with CUTLASS headers.\"\n        )\n    return unique_paths\n","sourceCodeStart":119,"sourceCodeEnd":142,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/kernels/jit/utils/deps.py#L119-L142","documentation":"SGLang's JIT compiler needs CUTLASS headers to build CUTLASS-based kernels and resolves them from installed packages (flashinfer or deep_gemm ship CUTLASS headers). get_cutlass_include_paths() collects candidate include directories from those packages; if after deduplication no path exists, it raises this RuntimeError.","triggerScenarios":"Compiling a JIT kernel that declares a cutlass dependency (calls get_cutlass_include_paths()) when neither flashinfer nor deep_gemm (nor any other searched package) is installed, or the installed versions do not ship include/ directories with CUTLASS headers.","commonSituations":"Minimal/lean install of sglang-srt without flashinfer or deep_gemm extras; a pip upgrade replaced flashinfer with a wheel variant that omits bundled CUTLASS headers; running in a slim container where headers were stripped to save image size.","solutions":["pip install flashinfer (its wheel bundles CUTLASS headers)","pip install deep_gemm as an alternative header source","Ensure the package's include directory actually contains cutlass/ (check site-packages/flashinfer/include/cutlass); reinstall if the install is broken","Manually place CUTLASS headers where the resolver looks, or update to an sglang version matching your installed flashinfer/deep_gemm"],"exampleFix":"# before: neither package present -> RuntimeError\npip install flashinfer-python -U --extra-index-url https://flashinfer.ai/whl/cu124\n# after: headers resolvable\npython -c \"from sglang.kernels.jit.utils.deps import get_cutlass_include_paths; print(get_cutlass_include_paths())\"","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('flashinfer') is None and importlib.util.find_spec('deep_gemm') is None:\n    raise SystemExit('Install flashinfer or deep_gemm (CUTLASS headers) before JIT compilation')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include flashinfer in the base requirements when using CUTLASS-based JIT kernels","Verify site-packages/<pkg>/include/cutlass exists after install in CI","Cache the resolved include paths check as an early smoke test"],"tags":["cutlass","jit-kernel","missing-dependency","flashinfer","deep-gemm","build"],"backgroundTag":"missing-optional-dependency","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}