vllm.model_executor.layers.mamba.mamba_utils
MambaStateDtypeCalculator ¶
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
linear_attention_state_dtype classmethod
¶
linear_attention_state_dtype(
model_dtype: Union[ModelDType, dtype],
mamba_cache_dtype: MambaDType,
) -> tuple[dtype, ...]
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
mamba1_state_dtype classmethod
¶
mamba1_state_dtype(
model_dtype: Union[ModelDType, dtype],
mamba_cache_dtype: MambaDType,
mamba_ssm_cache_dtype: MambaDType,
) -> tuple[dtype, ...]
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
mamba2_state_dtype classmethod
¶
mamba2_state_dtype(
model_dtype: Union[ModelDType, dtype],
mamba_cache_dtype: MambaDType,
mamba_ssm_cache_dtype: MambaDType,
) -> tuple[dtype, ...]
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
short_conv_state_dtype classmethod
¶
short_conv_state_dtype(
model_dtype: Union[ModelDType, dtype],
mamba_cache_dtype: MambaDType,
) -> tuple[dtype, ...]
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
MambaStateShapeCalculator ¶
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
extra_groups_for_head_shards classmethod
¶
Compute the increase in group numbers to account for replication in order to accompany the head shards.
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
linear_attention_state_shape classmethod
¶
linear_attention_state_shape(
num_heads: int, tp_size: int, head_dim: int
) -> tuple[tuple[int, int, int], ...]
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
mamba1_state_shape classmethod
¶
mamba1_state_shape(
tp_world_size: int,
intermediate_size: int,
state_size: int,
conv_kernel: int,
use_v1: bool = True,
) -> tuple[tuple[int, int], tuple[int, int]]
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
mamba2_state_shape classmethod
¶
mamba2_state_shape(
tp_world_size: int,
intermediate_size: int,
n_groups: int,
num_heads: int,
head_dim: int,
state_size: int,
conv_kernel: int,
use_v1: bool = True,
) -> tuple[tuple[int, int], tuple[int, int, int]]
Source code in vllm/model_executor/layers/mamba/mamba_utils.py
short_conv_state_shape classmethod
¶
short_conv_state_shape(
tp_world_size: int,
intermediate_size: int,
conv_kernel: int,
use_v1: bool = True,
) -> tuple[tuple[int, int]]