Default missing deepseek_yarn original_max_position_embeddings instead of raising - #4653
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
There was a problem hiding this comment.
Pull request overview
This PR makes AITER’s deepseek_yarn RoPE configuration handling more robust by defaulting a missing rope_scaling["original_max_position_embeddings"] to max_position (with a warning) instead of raising a KeyError, aligning behavior with SGLang and unblocking GLM-4.7-Flash loading when SGLang relabels RoPE scaling as deepseek_yarn.
Changes:
- Add
_get_rope_param()helper to fetchrope_scalingparameters with a warning-and-default fallback. - Use the helper in the
deepseek_yarnbranch to avoidKeyErrorwhenoriginal_max_position_embeddingsis absent. - Wire in
aiter.loggerfor consistent logging.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi @junhaha666, could you please help review this PR when you get a chance? This is currently blocking the Miles CI for GLM-4.7-Flash on ROCm. Thanks! |
Motivation
AITER's
deepseek_yarnRoPE path requiresrope_scaling["original_max_position_embeddings"]and raisesKeyErrorwhen the key is missing.This breaks GLM-4.7-Flash loading on ROCm with
SGLANG_USE_AITER=1:GLM-4.7-Flash does not define YaRN parameters in its config, but SGLang relabels the generated
rope_scalingdict asdeepseek_yarn. SGLang's own RoPE implementation already handles this case by defaultingoriginal_max_position_embeddingstomax_position; AITER does not.Technical Details
This PR ports SGLang's
_get_rope_param()fallback to AITER and uses it fororiginal_max_position_embeddingsin thedeepseek_yarnbranch. SGLang added the fallback in sgl-project/sglang#17784.Related code:
factory.py::_get_rope_param()factory.py::deepseek_yarnTest Plan
MI355X / gfx950 / ROCm 7.2.
deepseek_yarnwith and withoutoriginal_max_position_embeddings.Test Result
original_max_position_embeddingsKeyErrorRL validation completed with TP2 / PP2 / EP2, EAGLE speculative decoding, and MTP.
Submission Checklist