Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion src/maxtext/checkpoint_conversion/utils/hf_model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,40 @@
vocab_size=151936,
)

qwen3_30b_a3b_base_config = transformers.Qwen3MoeConfig(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you have qwen3_30b_a3b_thinking_2507_config inherit from qwen3_30b_a3b_base_config and just override rope_theta=1000000?

also @parambole could you review qwen3-30b base model config change to match hf?

architectures=["Qwen3MoeForCausalLM"],
attention_bias=False,
attention_dropout=0.0,
bos_token_id=151643,
decoder_sparse_step=1,
eos_token_id=151645,
head_dim=128,
hidden_act="silu",
hidden_size=2048,
initializer_range=0.02,
intermediate_size=6144,
max_position_embeddings=262144,
max_window_layers=48,
model_type="qwen3_moe",
moe_intermediate_size=768,
norm_topk_prob=True,
num_attention_heads=32,
num_experts=128,
num_experts_per_tok=8,
num_hidden_layers=48,
num_key_value_heads=4,
output_router_logits=False,
rms_norm_eps=1e-06,
rope_scaling=None,
rope_theta=1000000,
router_aux_loss_coef=0.001,
sliding_window=None,
tie_word_embeddings=False,
torch_dtype="bfloat16",
use_cache=True,
vocab_size=151936,
)

qwen3_235b_a22b_thinking_2507_config = transformers.Qwen3MoeConfig(
architectures=["Qwen3MoeForCausalLM"],
attention_bias=False,
Expand Down Expand Up @@ -1579,7 +1613,7 @@ def __init__(self, **kwargs):
"llama3.1-70b": llama31_70b_config,
"llama3.1-405b": llama31_405b_config,
"qwen3-30b-a3b": qwen3_30b_a3b_thinking_2507_config,
"qwen3-30b-a3b-base": qwen3_30b_a3b_thinking_2507_config,
"qwen3-30b-a3b-base": qwen3_30b_a3b_base_config,
Comment thread
JamesDeng42 marked this conversation as resolved.
"qwen3-235b-a22b": qwen3_235b_a22b_thinking_2507_config,
"qwen3-480b-a35b": qwen3_coder_480b_a35b_config,
"deepseek2-16b": deepseek2_16b_config,
Expand Down
1 change: 1 addition & 0 deletions src/maxtext/checkpoint_conversion/utils/hf_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ def MIXTRAL_HF_WEIGHTS_TO_SHAPE(config):
"llama3.1-70b": LLAMA31_HF_WEIGHTS_TO_SHAPE,
"llama3.1-405b": LLAMA31_HF_WEIGHTS_TO_SHAPE,
"qwen3-30b-a3b": QWEN_HF_WEIGHTS_TO_SHAPE,
"qwen3-30b-a3b-base": QWEN_HF_WEIGHTS_TO_SHAPE,
"qwen3-235b-a22b": QWEN_HF_WEIGHTS_TO_SHAPE,
"qwen3-480b-a35b": QWEN_HF_WEIGHTS_TO_SHAPE,
"deepseek2-16b": DEEPSEEK_HF_WEIGHTS_TO_SHAPE,
Expand Down
2 changes: 1 addition & 1 deletion src/maxtext/configs/models/qwen3-30b-a3b-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ base_moe_mlp_dim: 768
norm_topk_prob: true

# RoPE Settings
rope_max_timescale: 10_000_000
rope_max_timescale: 1_000_000

# General Model Settings
enable_dropout: false
Loading