{"record":{"id":"20d81a7a9ce1898e","repo":"sgl-project/sglang","slug":"lplb-fused-solver-unavailable-unavailable-reaso","errorCode":null,"errorMessage":"LPLB fused solver unavailable: {_unavailable_reason()}","messagePattern":"LPLB fused solver unavailable: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"python/sglang/kernels/ops/lplb/torch_solver.py","lineNumber":93,"sourceCode":"    if cap[0] < 9:\n        return f\"GPU SM {cap[0]}.{cap[1]} < 9.0 (requires Hopper or newer)\"\n    return (\n        \"Math-DX cuBLASDx headers not found — install via \"\n        \"`pip install nvidia-mathdx` or set MATHDX_HOME\"\n    )\n\n\ndef warmup(nc: int, nv: int, num_iters: int = 5, device: str = \"cuda\") -> None:\n    \"\"\"Pre-JIT-compile the fused kernel for a given (NC, NV) shape.\n\n    Call once per unique shape at solver construction time to hide the\n    20-40s JIT compilation cost. Raises if the fused backend is\n    unavailable, the shape exceeds the shmem budget, or the kernel\n    fails to compile/launch.\n    \"\"\"\n    _init_fused_backend()\n    if not _FUSED_AVAILABLE:\n        raise RuntimeError(f\"LPLB fused solver unavailable: {_unavailable_reason()}\")\n    _FUSED_ASSERT_FITS(nc, nv, gpu=\"h100\")\n    _FUSED_WARMUP(nc, nv, num_iters=num_iters, device=device)\n\n\ndef solve_ipm(\n    A: torch.Tensor,\n    b: torch.Tensor,\n    c: torch.Tensor,\n    num_iters: int = 5,\n) -> torch.Tensor:\n    \"\"\"Barrier-method Interior Point solver for standard-form LP.\n\n    Dispatches to the JIT-compiled CUDA C++ kernel (Hopper+ GPU with\n    Math-DX cuBLASDx headers, reachable via ``nvidia-mathdx`` PyPI\n    package or ``MATHDX_HOME``). Raises if the fused backend is\n    unavailable or the inputs aren't on CUDA in float32.\n\n    Args:","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/kernels/ops/lplb/torch_solver.py#L75-L111","documentation":"warmup for the LPLB fused solver tries to lazily initialize the fused backend (tvm_ffi/CUDA module) and raises if that backend could not be imported or compiled. _unavailable_reason() carries the underlying cause (missing wheel, no CUDA, JIT compile failure). It fires before any GPU work, during the warmup that pre-pays the 20-40s JIT cost.","triggerScenarios":"Calling warmup(nc, nv, ...) when the fused extension is not importable in the current environment (missing sglang kernel wheel, no CUDA toolchain for JIT, wrong arch).","commonSituations":"CPU-only CI machines; a broken/incomplete install of sglang-kernels; CUDA arch mismatch preventing JIT compilation; first use in a container without nvcc.","solutions":["Read _unavailable_reason() output and fix the root cause (usually pip install the missing kernels wheel or fix CUDA_HOME/nvcc)","Verify torch.cuda.is_available() and the GPU arch is supported before warmup","Fall back to solve_ipm_torch_reference on machines where the fused backend cannot be provisioned"],"exampleFix":"// before\nwarmup(nc, nv)\n\n// after\ntry:\n    warmup(nc, nv)\nexcept RuntimeError:\n    use_fused = False  # route to solve_ipm_torch_reference","handlingStrategy":"fallback","validationCode":"from sglang.kernels.ops.lplb.torch_solver import _FUSED_AVAILABLE\nif not _FUSED_AVAILABLE:\n    plan = 'torch_reference'","typeGuard":null,"tryCatchPattern":"try:\n    warmup(nc, nv)\nexcept RuntimeError as e:\n    if 'unavailable' in str(e):\n        fallback_to_reference = True\n    else:\n        raise","preventionTips":["Run warmup during server startup where fallback selection is still possible","Log _unavailable_reason() once so environment gaps (missing wheel, no nvcc) are visible in ops dashboards"],"tags":["lplb","backend-unavailable","jit","cuda"],"backgroundTag":"optional-dependency-missing","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}