Skip to content

vllm.v1.attention.backends.mla.prefill.base

Abstract base class for MLA prefill backends.

Classes:

MLAPrefillBackend

Bases: ABC

Abstract base class for MLA prefill backends.

Methods:

  • prepare_metadata –

    Prepare backend-specific metadata before the forward pass.

  • supports_out –

    Whether run_prefill_new_tokens and run_prefill_context_chunk honor

  • supports_quant_output –

    Whether run_prefill_new_tokens can write quantized output

prepare_metadata(prefill_metadata)

Prepare backend-specific metadata before the forward pass.

Called by the metadata builder after constructing the prefill metadata.

supports_out()

Whether run_prefill_new_tokens and run_prefill_context_chunk honor a caller-provided out tensor of shape [num_tokens, num_heads, v_head_dim], writing the result into it in place and returning it.

When True, callers may pass out and skip the post-hoc slice/flatten/copy -- and, for context chunks, size the accumulating partial before running any chunk. False for backends that ignore out or emit a padded (qk_head_dim) output. Overridden by backends that support it.

supports_quant_output(quant_key)

Whether run_prefill_new_tokens can write quantized output directly (fused) for the given quant key, skipping the post-quant pass. Overridden by backends that support it.