Repository navigation
fix RL ci - #3930
Merged
Merged
fix RL ci#3930
Conversation
liangel-02
marked this pull request as ready for review
July 16, 2026 15:17
liangel-02
force-pushed
the
fix-vllm-kv-cache-layout-packing
branch
from
July 16, 2026 17:30
52f5e30 to
42f330f
Compare
wwwjn
approved these changes
Jul 16, 2026
wwwjn
left a comment
Contributor
There was a problem hiding this comment.
Thanks for fixing! The vllm upstream kv cache layout change has broken us twice, which I don't know how to prevent this..
mreso
added a commit
to mreso/torchtitan
that referenced
this pull request
Jul 17, 2026
Absorbs 3 upstream commits: RL CI fix (pytorch#3930), the FlexAttention spmd_types output typing change (pytorch#3924), and pytorch#3859 ("[MoE] sibling token_dispatcher + grouped_experts for composable override"), which refactored the core MoE. pytorch#3859 required adapting the HF backend (no git conflicts, but silent API/struct breakage): - moe_replacement.py: make_experts_config -> make_routed_experts_config + make_moe_config(routed_experts=...); dropped the token_dispatcher kwarg from the GroupedExperts.Config probe (token_dispatcher moved to RoutedExperts). - parallelize.py: FSDP expert sharding reads moe.routed_experts.inner_experts (was moe.experts). - state_dict_adapter.py: titan MoE expert FQNs moved experts.* -> routed_experts.inner_experts.*; the adapter still emitted the old prefix, so load_state_dict(strict=False) silently skipped the expert weights (random init -> HF-vs-titan forward cos ~= 0 while the round-trip still passed). Route the routed-expert keys through the new prefix; also tighten the gate_up/down special-cases to ".experts." so shared_experts can't be misrouted. Verified: MoE numerical equivalence restored (qwen3_moe/deepseek_v2/olmoe PASS cos ~= 1.0; mixtral WARN at cos 0.999996 -- the documented bf16-combine band, not structural); round-trips max_diff=0.00; MoE EP=2 trains 12.33 -> 6.72.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vllm changed their flashattentionimpl.forwrad to a new unpacking in this pr vllm-project/vllm#44455 so update titan's to match