core.ssm.mamba_hybrid_layer_allocation#
Module Contents#
Classes#
Symbols for different layer types. |
Functions#
Allocates layers according to the requested distribution of layer types. |
|
Returns maps from global layer index to the corresponding layer index for each layer type in [Attention, Mamba, MLP, MoE] given a layer type list. |
Data#
API#
- core.ssm.mamba_hybrid_layer_allocation.logger#
‘getLogger(…)’
- class core.ssm.mamba_hybrid_layer_allocation.Symbols#
Symbols for different layer types.
- MAMBA#
‘M’
- ATTENTION#
‘*’
- MLP#
‘-’
- MOE#
‘E’
- VALID#
None
- core.ssm.mamba_hybrid_layer_allocation._allocate_auto(
- total_layers_count: int,
- target_attention_ratio: float,
- target_mlp_ratio: float,
- core.ssm.mamba_hybrid_layer_allocation._allocate_override(
- total_layers_count: int,
- override_pattern: str,
- core.ssm.mamba_hybrid_layer_allocation._layer_counts_match(a: list, b: list) bool#
- core.ssm.mamba_hybrid_layer_allocation.allocate_layers(
- total_layers_count: int,
- target_attention_ratio: float,
- target_mlp_ratio: float,
- override_pattern: str = None,
Allocates layers according to the requested distribution of layer types.
- core.ssm.mamba_hybrid_layer_allocation.get_layer_maps_from_layer_type_list(
- layer_type_list: List[str],
Returns maps from global layer index to the corresponding layer index for each layer type in [Attention, Mamba, MLP, MoE] given a layer type list.