LLaVA-OneVision-2 icon indicating copy to clipboard operation
LLaVA-OneVision-2 copied to clipboard

Support MLA YaRN RoPE scaling parameters

Open zhujian19891203 opened this issue 6 months ago • 0 comments

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.

zhujian19891203 avatar May 20 '26 04:05 zhujian19891203