LLaVA-OneVision-2
LLaVA-OneVision-2 copied to clipboard
Support MLA YaRN RoPE scaling parameters
Summary
- Add explicit MLA YaRN RoPE parameters for beta_fast, beta_slow, and original_max_position_embeddings.
- Use mscale_all_dim for MLA softmax scaling and pass original_max_position_embeddings to YarnRotaryEmbedding.
- Allow loading checkpoints with different max_position_embeddings, which is needed when YaRN uses an original context length and a scaled context length.
Background
The change follows Megatron-LM MLA/YaRN RoPE behavior; the exact upstream commit was not identified. This is related to NVIDIA/Megatron-LM#1418, which describes the dual meaning of max_position_embeddings for MLA YaRN RoPE.