vllm.v1.attention.backends.mamba_attn ¶
BaseMambaAttentionMetadataBuilder ¶
Bases: AttentionMetadataBuilder[M], ABC
Source code in vllm/v1/attention/backends/mamba_attn.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
block_idx_last_computed_token instance-attribute ¶
block_idx_last_computed_token = empty(
(decode_cudagraph_max_bs,), dtype=int32, device=device
)
block_idx_last_scheduled_token instance-attribute ¶
block_idx_last_scheduled_token = empty(
(decode_cudagraph_max_bs,), dtype=int32, device=device
)
cudagraph_support class-attribute ¶
cudagraph_support: AttentionCGSupport = (
UNIFORM_SINGLE_TOKEN_DECODE
)
decode_cudagraph_max_bs instance-attribute ¶
decode_cudagraph_max_bs = min(
max_num_seqs, max_cudagraph_capture_size
)
state_indices_tensor instance-attribute ¶
state_indices_tensor = empty(
(
decode_cudagraph_max_bs,
cdiv(max_model_len, block_size),
),
dtype=int32,
device=device,
)
__init__ ¶
__init__(
kv_cache_spec: AttentionSpec,
layer_names: list[str],
vllm_config: VllmConfig,
device: device,
)
Source code in vllm/v1/attention/backends/mamba_attn.py
_compute_prefix_caching_block_indices ¶
_compute_prefix_caching_block_indices(
common_attn_metadata: CommonAttentionMetadata,
mamba_block_size: int,
) -> tuple[Tensor, Tensor, Tensor]
Source code in vllm/v1/attention/backends/mamba_attn.py
build_for_cudagraph_capture ¶
build_for_cudagraph_capture(
common_attn_metadata: CommonAttentionMetadata,
) -> M
This method builds the metadata for full cudagraph capture. Currently, only decode is supported for full cudagraphs with Mamba.