mstar.model.components.qwen3_lm#
Dense Qwen3 causal language model from the shared components.
Qwen3 = Llama-style pre-norm decoder with GQA, per-head QK RMSNorm, SwiGLU
MLP and plain RoPE (rope_theta 1e6, no Llama-3 scaling). Several
audio-LLM checkpoints ship one as their text decoder (Qwen3-ASR, Higgs-Audio,
Qwen3-Omni’s dense layers); this is the one place to build it from
ParallelAttention / ParallelGatedMLP / RMSNorm, bound to the
KV, attention and position resources of the node that owns it.
Parameter paths mirror HF’s Qwen3ForCausalLM with the model. prefix
dropped (embed_tokens.*, layers.N.*, norm.*, lm_head.*); a
checkpoint that ties lm_head to the embedding loads without the head key.
Classes
|
|
|
- class mstar.model.components.qwen3_lm.Qwen3DenseLM(config, *, attn_key, kv_key, pos_key, comm_group=None)[source]#
Bases:
Module- Parameters:
config (Qwen3LMConfig)
attn_key (str)
kv_key (str)
pos_key (str)
comm_group (CommGroup | None)
- forward(input_embeds, *, label)[source]#
(tokens, hidden)->(tokens, hidden)after the final norm.The label and layer index are cursors on the shared resources: bind the label once, advance the index per layer. Passing them as arguments instead would make inductor specialize on the int.
- class mstar.model.components.qwen3_lm.Qwen3LMConfig(hidden_size: 'int' = 2048, num_hidden_layers: 'int' = 28, num_attention_heads: 'int' = 16, num_key_value_heads: 'int' = 8, head_dim: 'int' = 128, intermediate_size: 'int' = 6144, vocab_size: 'int' = 151936, rms_norm_eps: 'float' = 1e-06, rope_theta: 'float' = 1000000.0, max_position_embeddings: 'int' = 32768, tie_word_embeddings: 'bool' = False)[source]#
Bases:
object- Parameters: