Skip to content

[CI Fix][GraphTrainer] Build DeepSeek integration recipes with expert parallelism - #5426

Merged
acisseJZhong merged 2 commits into
mainfrom
codex/fix-graph-trainer-h100
Oct 15, 2026
Merged

acisseJZhong merged 2 commits into
mainfrom
codex/fix-graph-trainer-h100

Conversation

@acisseJZhong

@acisseJZhong acisseJZhong commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

GraphTrainer's DeepSeek integration recipes enable EP after building a model with EP disabled. Routed-expert weights consequently retain the dense placement instead of sharding the expert dimension on the sparse mesh. Pass expert_parallel_degree into the base recipe at construction time; retain the existing runtime mesh degrees and schedules.

This fixes the stale sharding configuration behind these five failures in the main H100 job:

Integration test Observed failure
aot_fx_trace_deepseek_v3_hsdp_edp_shard_ep KeyError: mesh_ep
aot_fx_trace_deepseek_v3_graph_pp_dual_pipe_v_full_inductor KeyError: mesh_ep
aot_fx_trace_deepseek_v3_graph_pp_zbv_zero_bubble_full_inductor KeyError: mesh_ep
aot_fx_trace_deepseek_v3_graph_pp_interleaved_1f1b_full_inductor KeyError: mesh_ep
aot_fx_trace_deepseek_v3_fused_mla_swiglu_fsdp_tp_ep RuntimeError: matrix batch sizes have to match

Root cause: #5280 (b81852f007) moved sharding to model-config construction and removed the runtime re-sharding step, but missed these derived integration recipes. Its direct parent's H100 run passed the integration stage; the run at #5280 first failed all five integrations. Both used torch==2.16.0.dev20261011+cu132. The fused test initially reported an ambient-mesh error and now reaches the grouped-matmul shape error. The missing EP placement was reproduced with a local CPU configuration check.

Pass EP at construction time in all seven affected callers of the default DeepSeek GraphTrainer recipe in integration_tests.py, covering 15 derived recipes. Existing integration tests exercise the fix. Other recipe families already build with the required EP-enabled layout or only change mesh degrees.

Validation:

  • Local CPU configuration check (kept outside the PR): expert-weight placement is incorrect in all 15 derived recipes before the fix and correct in all 15 after it.
  • The CPU check used isolated torch==2.16.0.dev20261015+cpu, with the shared environment's incompatible optional CUDA-only torchcomms package hidden from import. No model/sharding code was mocked.
  • Ran pre-commit run --all-files: all hooks except Pyrefly pass; Pyrefly reports 54 existing dependency/type errors outside this change. Restored unrelated automatic edits. Scoped lint passes with Pyrefly skipped.
  • Full H100 training/numerics still needs CI; keep this draft until verified. Earlier H100 runs also had separate bitwise-determinism failures after the integration stage, so fixing these configurations alone does not establish that the entire workflow is green.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 15, 2026
@acisseJZhong acisseJZhong changed the title [GraphTrainer] Build DeepSeek integration recipes with expert parallelism [CI Fix][GraphTrainer] Build DeepSeek integration recipes with expert parallelism Oct 15, 2026
@acisseJZhong
acisseJZhong marked this pull request as ready for review October 15, 2026 19:03
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Oct 15, 2026
@acisseJZhong
acisseJZhong merged commit 47511eb into main Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests 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