Skip to content

[fix][train] Reject unsafe MTP prefix caching - #2046

Open
bvolpato wants to merge 1 commit into
NovaSky-AI:mainfrom
bvolpato:bvolpato/guard-mtp-prefix-caching
Open

[fix][train] Reject unsafe MTP prefix caching#2046
bvolpato wants to merge 1 commit into
NovaSky-AI:mainfrom
bvolpato:bvolpato/guard-mtp-prefix-caching

Conversation

@bvolpato

@bvolpato bvolpato commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject MTP speculative decoding with prefix caching on recurrent linear-attention models.
  • Detect model capability from Hugging Face layer_types instead of model names.
  • Respect final engine_init_kwargs overrides for prefix caching and speculative decoding.
  • Disable prefix caching in the Qwen3.5 MTP recipe.

Why

Issue #1981 reports a Qwen3.6-27B accuracy collapse when MTP and prefix caching are combined. Current SkyRL config validation accepted that pair because prefix caching defaults to enabled. vLLM issue #43559 tracks the same failure class; proposed fixes #43650 and #50021 remain open and are not part of SkyRL’s pinned vLLM 0.26.0 release.

This guard fails during config validation and gives both supported mitigations: disable prefix caching or disable MTP. Full-attention MTP models and non-MTP hybrid models remain allowed.

Validation

  • Pre-fix CPU config reproduction: unsafe Qwen3.6 combination accepted.
  • Live Qwen3.6 config: unsafe pair rejected; MTP without prefix caching accepted; SKYRL_DISABLE_SPEC=1 accepted.
  • Focused config suite: 163 passed.
  • Negative control with guard bypassed: 2 expected regression failures.
  • Ruff, Black, and gitleaks pre-commit hooks
  • uv lock --check
  • Recipe bash -n
  • git diff --check

Fixes #1981

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a validation check to prevent using MTP speculative decoding with prefix caching enabled on models with recurrent linear-attention layers, which is unsafe. It also updates the configuration documentation, disables prefix caching in the example script, and adds corresponding unit tests. The reviewer recommended wrapping the model configuration loading (AutoConfig.from_pretrained) in a try...except block to prevent training from crashing in offline or air-gapped environments if the Hugging Face Hub is unreachable.

Comment thread skyrl/train/utils/utils.py
- reject effective MTP plus prefix caching on recurrent linear attention
- disable prefix caching in the Qwen3.5 speculative decoding recipe
- cover model capability and final engine override precedence
@bvolpato
bvolpato force-pushed the bvolpato/guard-mtp-prefix-caching branch from 78e70a0 to d4c2e5c Compare August 16, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Qwen3.6-27B MTP is unsafe with prefix caching enabled

1 participant