vllm.model_executor.layers.mamba.mamba_mixer2
¶
Classes:
-
MambaMixer2–Compute ∆, A, B, C, and D the state space parameters and compute
Functions:
-
mamba_v2_sharded_weight_loader–Create a weight loader for mamba v2. This ensures that the projections
MambaMixer2
¶
Bases: MambaBase, PluggableLayer
Compute ∆, A, B, C, and D the state space parameters and compute
the contextualized_states. A, D are input independent
(see Mamba paper [1] Section 3.5.2 "Interpretation of A"
for why A isn't selective) ∆, B, C are input-dependent
(this is a key difference between Mamba and the linear time
invariant S4, and is why Mamba is called
selective state spaces)
Methods:
-
D_bf16–Dcast to bfloat16 for FlashInfer's SSD, refreshed whenever the
mamba_v2_sharded_weight_loader(shard_spec, tp_size, tp_rank)
¶
Create a weight loader for mamba v2. This ensures that the projections are correctly sharded so that they can be split into x, B, C. It also ensures that all the groups corresponding to a head shard is placed together with it.