cosmos3_nano model bring up (patch PR#4475) - #4920
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for the NVIDIA Cosmos3-Nano Reasoner model, adding its configuration, parameter mapping, and integration across multimodal processing, rotary embeddings, and decoders. However, several critical issues must be addressed before merging. Specifically, there are multiple unresolved git merge conflict markers left in param_mapping.py and types.py. Additionally, the newly added unit tests in param_mapping_test.py reference a non-existent function (COSMOS3_TEXT_MAXTEXT_TO_HF_PARAM_MAPPING) and need to explicitly set maxtext_config.use_multimodal = False to avoid raising a KeyError during execution.
3b48326 to
5646513
Compare
5646513 to
a3f64f0
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
570f5a7 to
b31161c
Compare
b31161c to
4ab4029
Compare
4ab4029 to
b1736a3
Compare
b1736a3 to
d6b3a0a
Compare
Description
This PR adds support for the nvidia/Cosmos3-Nano model in MaxText.
Key Changes
COSMOS3_MAXTEXT_TO_HF_PARAM_MAPPING.qwen3_vlvision encoder block.Reference
Tests
Checkpoint Conversion
MODEL_NAME=cosmos3-nano-reasoner python3 -m maxtext.checkpoint_conversion.to_maxtext \ src/maxtext/configs/base.yml \ model_name=${MODEL_NAME?} \ base_output_directory=${MODEL_BUCKET} \ scan_layers=false \ use_multimodal=true \ hf_access_token=${HF_TOKEN?} \ hardware=cpu \ skip_jax_distributed_system=True \ checkpoint_storage_use_ocdbt=False \ checkpoint_storage_use_zarr3=False \ --eager_load_method=safetensors \ --lazy_load_tensors=FalseDecoding / Inference (Robotic Arm Planning)
python3 -m maxtext.inference.decode \ src/maxtext/configs/base.yml \ model_name=${MODEL_NAME?} \ tokenizer_path=nvidia/Cosmos3-Nano \ tokenizer_type=huggingface \ load_parameters_path=${checkpoint_path} \ per_device_batch_size=1 \ run_name=sft_decode \ scan_layers=false \ use_multimodal=true \ prompt='You are a robotic arm planner. The task is to put the flower into the red bottle. Generate a detailed plan consisting of sequential subtasks to accomplish the task.' \ image_path='tests/assets/test_image_reasoning.jpg' \ max_prefill_predict_length=1024 \ max_target_length=1124 \ ici_tensor_parallelism=4 \ override_model_config=true \ attention='dot_product' \ hf_access_token=${HF_TOKEN}Sample Output:
Checklist