Fix early CUDA init (#43791)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-05-27 09:30:11 -07:00
committed by GitHub
parent 49a3510266
commit 41688e2dc7
5 changed files with 12 additions and 21 deletions
+5 -16
View File
@@ -5,20 +5,9 @@
These modules import ``cutlass``/``cutedsl`` at module top level, so they must
not be imported on non-CUDA platforms. Callers should gate on
``vllm.utils.import_utils.has_cutedsl()`` before importing from here.
This ``__init__`` deliberately imports nothing: re-exporting the cutedsl
modules here would eagerly ``import cutlass`` (initializing the CUDA driver) for
anyone who imports ``vllm.models.deepseek_v4``, breaking forked subprocesses.
Import the leaf modules directly under a ``has_cutedsl()``/``is_cuda()`` gate.
"""
from .dequant_gather_k_cutedsl import dequantize_and_gather_k_cache_cutedsl
from .fused_indexer_q_cutedsl import (
fused_indexer_q_rope_quant_fp8_cutedsl,
fused_indexer_q_rope_quant_mxfp4_cutedsl,
)
from .prepare_megamoe import prepare_megamoe_inputs
from .sparse_attn_compress_cutedsl import compress_norm_rope_store_cutedsl
__all__ = [
"compress_norm_rope_store_cutedsl",
"dequantize_and_gather_k_cache_cutedsl",
"fused_indexer_q_rope_quant_fp8_cutedsl",
"fused_indexer_q_rope_quant_mxfp4_cutedsl",
"prepare_megamoe_inputs",
]