easydel.modules.qwen3.qwen3_configuration#

class easydel.modules.qwen3.qwen3_configuration.Qwen3Config(vocab_size=151936, hidden_size=4096, intermediate_size=22016, num_hidden_layers=32, num_attention_heads=32, num_key_value_heads=32, head_dim=128, hidden_act='silu', max_position_embeddings=32768, initializer_range=0.02, rms_norm_eps=1e-06, use_cache=True, tie_word_embeddings=False, rope_theta=10000.0, rope_scaling=None, attention_bias=False, use_sliding_window=False, sliding_window=4096, max_window_layers=28, attention_dropout=0.0, layer_types: list[str] | None = None, **kwargs)[source]#

Bases: EasyDeLBaseConfig

Configuration container for the Qwen3 decoder architecture.

get_mask_details() dict[int, easydel.infra.utils.AttnMaskDetail][source]#

Retrieve attention mask details for each layer in the model.

This method generates a dictionary mapping layer indices to their corresponding attention mask details. If a sliding window is defined, each layer is assigned a sliding window attention mask with the specified size.

Returns

A dictionary where keys are layer indices (int) and values are AttnMaskDetail objects specifying the attention mask type and size for each layer.

Return type

dict[int, AttnMaskDetail]

Notes

  • If self.sliding_window is None, an empty dictionary is returned.

  • The method iterates over self.num_hidden_layers to assign mask details for each layer.

  • The attention mask type is set to AttnMaskType.SLIDING when a sliding window is defined.

get_partition_rules(*args, **kwargs)[source]#

Get the partition rules for the model. :returns: The partition rules. :rtype: tp.Tuple[tp.Tuple[str, PartitionSpec]]

model_type: str = 'qwen3'#