Skip to content

fix RL ci - #3930

Merged
liangel-02 merged 1 commit into
mainfrom
fix-vllm-kv-cache-layout-packing
Jul 16, 2026
Merged

liangel-02 merged 1 commit into
mainfrom
fix-vllm-kv-cache-layout-packing

Conversation

@liangel-02

@liangel-02 liangel-02 commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

vllm changed their flashattentionimpl.forwrad to a new unpacking in this pr vllm-project/vllm#44455 so update titan's to match

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 16, 2026
@liangel-02
liangel-02 marked this pull request as ready for review July 16, 2026 15:17
@liangel-02
liangel-02 force-pushed the fix-vllm-kv-cache-layout-packing branch from 52f5e30 to 42f330f Compare July 16, 2026 17:30
@liangel-02
liangel-02 requested a review from wwwjn July 16, 2026 18:34

@wwwjn wwwjn 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.

Thanks for fixing! The vllm upstream kv cache layout change has broken us twice, which I don't know how to prevent this..

@liangel-02
liangel-02 merged commit fbceec0 into main Jul 16, 2026
11 of 13 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rl ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants