@@ -32,30 +32,29 @@ def test_qwen3_30b_a3b_roundtrip_conversion(self):
3232 model_name = "qwen3-30b-a3b"
3333 base_num_decoder_layers = 2
3434 with tempfile .TemporaryDirectory () as tmpdir :
35- cmd = [
35+ to_mt_cmd = [
3636 sys .executable ,
3737 "-m" ,
3838 "maxtext.checkpoint_conversion.to_maxtext" ,
39- "src/maxtext/configs/base.yml" ,
4039 f"model_name={ model_name } " ,
4140 f"base_output_directory={ tmpdir } " ,
4241 f"base_num_decoder_layers={ base_num_decoder_layers } " ,
4342 "override_model_config=True" ,
4443 "scan_layers=False" ,
45- "weight_dtype=bfloat16" ,
4644 "hardware=cpu" ,
4745 "skip_jax_distributed_system=True" ,
4846 "checkpoint_storage_use_ocdbt=False" ,
4947 "checkpoint_storage_use_zarr3=False" ,
48+ "--save_dtype=bfloat16" ,
5049 "--lazy_load_tensors=True" ,
5150 ]
5251 env = os .environ .copy ()
5352 env ["JAX_PLATFORMS" ] = "cpu"
5453 env ["HF_HOME" ] = tmpdir
5554
56- print ("Running checkpoint conversion command:" , " " .join (cmd ))
55+ print ("Running checkpoint conversion command:" , " " .join (to_mt_cmd ))
5756 # Inherit stdout and stderr from the parent process to stream logs in real time
58- subprocess .run (cmd , env = env , check = True )
57+ subprocess .run (to_mt_cmd , env = env , check = True )
5958
6059 # Verify output directory exists and contains items
6160 # Output structure: tmpdir/0/items
@@ -65,7 +64,7 @@ def test_qwen3_30b_a3b_roundtrip_conversion(self):
6564
6665 # Roundtrip conversion back to HuggingFace format
6766 expected_hf_dir = os .path .join (tmpdir , "hf_safetensor" , "qwen3-30b-a3b" )
68- hf_cmd = [
67+ to_hf_cmd = [
6968 sys .executable ,
7069 "-m" ,
7170 "maxtext.checkpoint_conversion.to_huggingface" ,
@@ -80,8 +79,8 @@ def test_qwen3_30b_a3b_roundtrip_conversion(self):
8079 "skip_jax_distributed_system=True" ,
8180 "--override_model_architecture=True" ,
8281 ]
83- print ("Running roundtrip checkpoint conversion command (to HF):" , " " .join (hf_cmd ))
84- subprocess .run (hf_cmd , env = env , check = True )
82+ print ("Running roundtrip checkpoint conversion command (to HF):" , " " .join (to_hf_cmd ))
83+ subprocess .run (to_hf_cmd , env = env , check = True )
8584
8685 # Verify HF output directory exists and contains safetensors/config files
8786 self .assertTrue (
0 commit comments