Skip to content

vllm.model_executor.warmup.jit_warmup_cutedsl_helper

Classes:

Functions:

VllmCuTeDSLJitKernel

Bases: VllmJitKernel[CompileKeyT], Generic[CompileKeyT]

CuTeDSL owner whose compiled executor is shared by warmup and runtime.

Methods:

  • warmup_inputs –

    Return fake arguments that compile one executor specialization.

Source code in vllm/model_executor/warmup/jit_warmup_cutedsl_helper.py
class VllmCuTeDSLJitKernel(VllmJitKernel[CompileKeyT], Generic[CompileKeyT]):
    """CuTeDSL owner whose compiled executor is shared by warmup and runtime."""

    kernel: ClassVar[Any]

    @abstractmethod
    def warmup_inputs(self, compile_key: CompileKeyT) -> tuple[Any, ...]:
        """Return fake arguments that compile one executor specialization."""
        raise NotImplementedError

    def compile(self, compile_key: CompileKeyT) -> None:
        if compile_key in self._compiled_cache:
            return
        self._compiled_cache[compile_key] = compile_cutedsl(
            self.kernel(compile_key),
            *self.warmup_inputs(compile_key),
        )

warmup_inputs(compile_key) abstractmethod

Return fake arguments that compile one executor specialization.

Source code in vllm/model_executor/warmup/jit_warmup_cutedsl_helper.py
@abstractmethod
def warmup_inputs(self, compile_key: CompileKeyT) -> tuple[Any, ...]:
    """Return fake arguments that compile one executor specialization."""
    raise NotImplementedError

cutedsl_kernel_launcher(call_fn)

Invoke a cached CuTeDSL executor from a declarative __call__.

Source code in vllm/model_executor/warmup/jit_warmup_cutedsl_helper.py
def cutedsl_kernel_launcher(
    call_fn: Callable[..., CuTeDSLLaunchSpec[CompileKeyT]],
) -> Callable[..., Any]:
    """Invoke a cached CuTeDSL executor from a declarative ``__call__``."""

    @wraps(call_fn)
    def wrapper(
        self: VllmCuTeDSLJitKernel[CompileKeyT],
        *args: Any,
        **kwargs: Any,
    ) -> Any:
        compile_key, launch_args, runtime_context = call_fn(self, *args, **kwargs)
        executor = self._get_or_compile(
            compile_key,
            runtime_context=runtime_context,
        )
        return executor(*launch_args)

    return wrapper