Skip to content

vllm.v1.attention.backends.mla.compressor_utils

Functions:

get_dspark_swa_index_width(window_size, num_speculative_tokens)

Return the padded width of non-causal DSpark SWA indices.

Source code in vllm/v1/attention/backends/mla/compressor_utils.py
def get_dspark_swa_index_width(
    window_size: int,
    num_speculative_tokens: int,
) -> int:
    """Return the padded width of non-causal DSpark SWA indices."""
    width = max(int(window_size), 0) + max(int(num_speculative_tokens), 0)
    return cdiv(width, _DSPARK_SWA_INDEX_ALIGNMENT) * _DSPARK_SWA_INDEX_ALIGNMENT