Skip to content

vllm.lora.ops.triton_ops.lora_kernel_metadata

LoRA kernels metadata preparation utilities.

Classes:

LoRAKernelMeta dataclass

Methods:

  • meta_args –

    This function returns the kernel metadata required for the current

  • prepare_tensors –

    Prepare kernel metadata tensors for the current forward pass.

meta_args(token_nums, specialize_active_lora)

This function returns the kernel metadata required for the current forward pass execution of the kernel. The function returns all the metadata required by the kernel, in order, as a tuple, so it can be unpacked directly during the lora_shrink/lora_expand function call.

Parameters:

  • token_nums

    (int) –

    Number of input tokens in the current forward pass of the kernel.

  • specialize_active_lora

    (bool) –

    If True, report the actual active LoRA count; otherwise report the padded default, which keeps the kernel launch shape stable.

prepare_tensors(token_lora_mapping)

Prepare kernel metadata tensors for the current forward pass.

Parameters:

  • token_lora_mapping

    (Tensor) –

    Tensor containing lora indices for each input token.