Repository navigation
[graph_trainer] Drop "schedule" FSDP modes for SPMD gradient accumulation - #4998
Closed
SherlockNoMad wants to merge 20 commits into
Closed
SherlockNoMad wants to merge 20 commits into
SherlockNoMad wants to merge 20 commits into
Conversation
## Summary Removes the `compile.debug_graph_passes` flag from `GraphTrainerCompileConfig`. The per-pass instrumentation that used to sit behind it now always runs in `apply_graph_passes`: - the graph is dumped to tlparse before and after each pass - each pass's wall-clock time is logged - each pass's op-count / node-count diff is logged ## Why This information is what you want whenever you're looking at a GraphTrainer compile, and having to re-run with a flag to get it is friction. Keeping it always on costs very little: - The tlparse dumps go through `trace_structured` with a lazy `payload_fn`, so the graph is only printed when `TORCH_TRACE` is set. - `snapshot_graph` is a single O(num_nodes) walk per pass, which is negligible next to tracing and compilation. The visible change is more log output: each compile prints one timing line and one diff block per pass on the logging rank. ## Changes - `configs.py`: drop `debug_graph_passes`. - `passes.py`: remove the `debug` gating in `apply_graph_passes`. - `debug_utils.py`: drop the `debug` parameter from `tlparse_log_graph_pass` (`apply_graph_passes` was its only caller). `seq_nr` is now always included in the printed node metadata. - `graph_trainer/.claude/CLAUDE.md`: update the "Debugging Graph Passes" section. Recipes or CLI invocations that set `compile.debug_graph_passes` will need to drop it. ## Testing - `pytest torchtitan/experiments/graph_trainer/tests/test_passes.py`: 182 passed, 1 skipped. - Numerics are unaffected: only logging and tlparse dumps changed, and no pass behavior changed.
…#4973) Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.12.0) (oldest at bottom): * __->__ #4973 Issue: any MoE model with EP=1 on more than one rank (FSDP/HSDP/CP-only, since MoE requires EP >= TP) crashed in core FSDP: ValueError: When dp_mesh_dims is provided, all parameters must be DTensors on the full SPMD mesh ... Got plain tensor for parameter 'weight'. Why: without EP, `_routed_experts_sharding_configs` set the routed `w13`/`w2` sharding configs to `None`, so expert weights never got spmd_types annotations and stayed plain tensors, which FSDP rejects once `dp_mesh_dims` is set. Fix: give them the dense param placement (Replicate on DP/CP/TP) when EP is off, so FSDP shards them on the dense mesh like other dense params. EP configs are unchanged, and on a single rank the annotations are filtered out, so existing numerics/gold losses (all EP > 1) are unaffected. Callsites: - gpt_oss: expert biases now always follow their weight's placement (previously only annotated under EP, so they would also stay plain). - Grouped LoRA: accept the dense placement too. The configs are always set now, so keeping the EP-only check would reject every EP=1 LoRA run. Test Plan (8x H100, EP=1, TP=1, 3 steps; all crashed or would crash before): - FSDP=8: qwen3_moe_debug, gpt_oss_debugmodel, deepseek_v3_debugmodel, deepseek_v4_debugmodel, kimi_k3_debugmodel - FSDP=4, PP=2: qwen35_debugmodel_moe, qwen35_debugmodel_moe_float8_lora - HSDP 2x4: qwen3_moe_debug - FSDP=2, CP=2, PP=2: deepseek_v3_debugmodel_fsdp2_cp2_pp2_ep4 (EP=1) - EP path sanity: qwen3_moe_debug FSDP=4, TP=2, EP=2 - CPU: test_moe.py, test_lora.py, test_qwen3_5.py (no new failures) Follow-up (waits for #4949 to land): graph_trainer simple FSDP's non-EP path shards the stacked W13 expert weight on dim 2 while core shards routed experts on dim 0, so graph_trainer qwen3 MoE EP=1 diverges from eager at step 1. That fix needs #4949's `param_shard_placements` argument.
SherlockNoMad
requested review from
IvanKobzarev,
aditvenk,
sanketpurandare and
tianyu-l
as code owners
October 1, 2026 18:28
) Stacked on #4980. ## Why GraphRuntime construction threaded `compile_config`, `model_config`, `parallelism` and `trainer_config` side by side. On PP=1 the first three are always `trainer_config.compile` / `.model` / `.parallelism`, so they were pure duplication. PP>1 enters through core's generic `model.pipeline(**kwargs)` API and only has the decomposed fields, which is why both shapes existed. ## What - `make_graph_runtime`, `_register_graph_runtime`, `_make_pipeline_parallel_graph_runtime`, `GraphTrainerStageGraphProvider`, `_build_stage_graphs` and `_apply_graph_pp_pre_partition_or_extraction_passes` take a single `config: GraphTrainer.Config | GraphTrainerConfigView`. - `_GraphTrainerPassConfigView` is renamed to `GraphTrainerConfigView` (`compile`, `parallelism`, `model`) and is built once in `graph_pipeline_llm`. Core's pipelining API is unchanged. - PP=1-only builders (`make_spmd_graph_runtime`, `_make_spmd_graph_runtime`, `_build_fwd_bwd_graphs`, `_build_scheduled_fwd_bwd_graphs`, `_extract_fwd_bwd_action_graphs`) take only `trainer_config`; the `trainer.py` call drops three arguments. - The provider selects the PP=1 vs PP>1 path from `plan.pp_enabled` instead of `trainer_config is not None`. - Removed the "model_config and parallelism required when passes are enabled" ValueError; the view makes those fields required. Helpers that only need compile settings (`apply_graph_passes`, `_compile_graph_pp_module`, scheduling/compile helpers) still take `compile_config`. No behavior change intended; this is a pure plumbing refactor. ## Test plan - `pytest torchtitan/experiments/graph_trainer/tests/test_graph_pp_runner.py torchtitan/experiments/graph_trainer/tests/test_trace_module.py`: 111 passed, 3 skipped - `pre-commit` clean on changed files; pyrefly reports no errors in changed files
## Summary - Enable the `swiglu` local-compile target by default for the shared torch-native SwiGLU activation. - Fuse SiLU and multiplication in TorchInductor-generated forward and backward kernels. - Keep the handwritten Triton override for sparse fixed-capacity expert buffers. `LocalCompileConfig()` enables SwiGLU local compile by default. Stacked on #4928. ## Performance One H100 with BF16 inputs, 20 warmup iterations, 100 timed forward+backward iterations per trial, five trials, and synchronized CUDA events. Values are median trial averages and include gate and up gradients. `T` is the token-row count, `R` is grouped-expert buffer capacity, `F` is the SwiGLU hidden width, and `R_valid = offsets[-1]`. A speedup above `1.0x` means local compile is faster. ### DeepSeek V3 training shapes `T = 65,536` comes from four 16,384-token sequences per DP rank. Balanced routed-expert rows are `R_valid = T * top_k / EP`: 49,152 for 16B EP8 and 262,144 for 671B EP2. Hidden widths come from the model flavors. | Workload | Shape `[T/R, F]` | `R_valid` | Eager | Triton | Local compile | Speedup vs eager | Speedup vs Triton | | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | 16B dense FFN | `[65536, 10944]` | N/A | 8.90 ms | 5.48 ms | 5.09 ms | **1.75x** | **1.08x** | | 236B dense FFN | `[65536, 12288]` | N/A | 9.99 ms | 6.01 ms | 5.72 ms | **1.75x** | **1.05x** | | 671B dense FFN | `[65536, 18432]` | N/A | 15.00 ms | 8.81 ms | 8.58 ms | **1.75x** | **1.03x** | | 16B shared experts | `[65536, 2816]` | N/A | 2.31 ms | 1.36 ms | 1.32 ms | **1.75x** | **1.03x** | | 236B shared experts | `[65536, 3072]` | N/A | 2.52 ms | 1.46 ms | 1.44 ms | **1.75x** | **1.01x** | | 671B shared expert | `[65536, 2048]` | N/A | 1.68 ms | 0.97 ms | 0.96 ms | **1.75x** | **1.01x** | | 16B routed experts, EP8 compact | `[49152, 1408]` | 49,152 | 0.88 ms | 0.51 ms | 0.51 ms | **1.72x** | **0.99x** | | 671B routed experts, EP2 compact | `[262144, 2048]` | 262,144 | 6.67 ms | 3.85 ms | 3.89 ms | **1.71x** | **0.99x** | | 671B HybridEP CF=1, 25% utilized | `[1048576, 2048]` | 262,144 | 26.65 ms | 4.07 ms | 15.46 ms | **1.72x** | **0.26x** | ### Grouped-buffer utilization crossover Local compile evaluates the full buffer, while handwritten Triton reads `R_valid` on the GPU and skips padded tiles. | Buffer `[R, F]` | `R_valid` | Utilization | Triton | Local compile | Speedup vs Triton | | --- | ---: | ---: | ---: | ---: | ---: | | `[32768, 2048]` | 8,192 | 25% | 183.49 us | 485.85 us | **0.38x** | | `[32768, 2048]` | 16,384 | 50% | 251.80 us | 486.28 us | **0.52x** | | `[32768, 2048]` | 24,576 | 75% | 371.20 us | 485.72 us | **0.76x** | | `[32768, 2048]` | 32,768 | 100% | 491.07 us | 486.16 us | **1.01x** | For DeepSeek V3 shapes, local compile is 1.71-1.75x faster than eager. It is 1.01-1.08x faster than Triton for dense/shared activations and within about 1% for compact routed experts. Small shapes can regress versus eager (for example, `[2048, 1792]` measured 0.51x), but the representative DeepSeek V3 training shapes support enabling the target by default. The Triton override remains valuable for sparse fixed-capacity buffers: it is 3.80x faster for the 25%-utilized 671B HybridEP case. A tensor mask would still scan the full buffer, while reading `R_valid` on the host would add synchronization. These are isolated operator measurements, not end-to-end training results. ## Numerics BF16 results on one H100: | Case | Repeated fwd+bwd deterministic | Batch invariant | Maximum output/gradient difference | | --- | --- | --- | ---: | | Dense `[8192, 3584]` | Yes | Yes, full batch vs two half-batches | 0 | | Grouped `[32768, 2048]`, `R_valid = 8192` | Yes | Yes, fixed-capacity vs compact valid rows | 0 | The compiled output, `grad_gate`, and `grad_up` are bitwise identical in all comparisons. ## Testing - Inductor emits Triton code for SwiGLU forward and backward. - Relevant CPU/GPU tests: 27 passed. - All enabled pre-commit hooks passed; Pyrefly was skipped because of unrelated environment errors.
## Why A policy update changes the model weights but does not automatically invalidate vLLM's cached KV. Letting a newly started rollout hit KV created by an older policy would give it stale prefix state. Clearing the entire cache prevents that reuse, but it also preempts every active request and makes long-running, multi-turn rollouts prefill their accumulated context again. This change supports two explicit KV-cache lifecycle modes. ### Mode 1: preserve version-salted KV (default) With `generator.reset_kv_cache_on_weight_sync=false`: 1. When a generator first admits a rollout (a routing session), rank 0 pins the rollout to the generator's installed policy version. Every later turn of that rollout on the same generator reuses the pin, and the generator passes it to vLLM as `cache_salt`. 2. A weight pull runs between `engine.step()` bursts. No request is admitted or advanced while the new weights are being installed, but existing requests and their KV blocks remain in vLLM. 3. After the pull, in-flight rollouts resume from their existing KV instead of being preempted and re-prefilled, and their later turns hit their own history under the pinned salt. 4. Rollouts first admitted after the pull are pinned to the new version. They cannot hit old-salt blocks, so their prefixes are computed with the new weights. 5. Old-salt blocks remain reusable by their original rollouts until vLLM evicts them normally. Each completion reports the pinned version as `min_policy_version`, since the completion may depend on KV cached under that version. `policy_age` and the `max_offpolicy_steps` check therefore account for the reused KV. This mode avoids reset-and-reprefill work and preserves cache locality across policy updates. Its tradeoff is that the salt is only a prefix-hash namespace; it does not guarantee that every KV block used by an in-flight rollout came from one weight version. A rollout can retain prefix KV produced by its starting policy and append new KV after newer weights have been installed. Because the salt is the version number, rollouts pinned at the same version on a generator share one namespace: they reuse common prefixes such as a system prompt with tool definitions, and after a pull that namespace can also hold KV computed under the newer weights. ### Mode 2: reset and re-prefill With `generator.reset_kv_cache_on_weight_sync=true`: 1. The generator installs the new weights. 2. It clears the prefix cache and the pins, and preempts running requests. 3. vLLM reschedules those requests and recomputes their accumulated context with the new weights before decode continues. **Config change.** `reset_kv_cache_on_weight_sync` replaces main's `reset_prefix_cache_on_weight_sync` and `reset_running_requests_on_weight_sync`, and the default flips from reset to preserve. Configs that set either old field must switch to the new one. Resetting the prefix cache while keeping running requests' KV is no longer an option: the version salt already gives new requests fresh KV without a reset, so a reset only matters as a strict recompute, which must include running requests. This mode provides strict recomputation under the latest installed policy and remains useful for exact trainer/generator comparisons (`batch_invariant` requires it). The additional prefill compute may also help overlap FSDP parameter all-gathers. The cost is extra prefill work, queueing, and latency, especially for long-running multi-turn rollouts. The default mode follows Prime-RL's behavior: a rollout keeps its start policy version as the cache salt, and the prefix cache is not cleared on weight updates. TorchTitan obtains these semantics without calling vLLM's asynchronous `pause_generation` API because weight pulls are serialized between `engine.step()` bursts. ## Where the salt lives The salt only matters inside one engine's KV pool, so each generator owns its pins: rank 0 keeps `group id -> routing session id -> pinned version` and fills it at admission. The router stays stateless. Placement belongs to the routing strategy. Later turns only hit their history if they return to the same generator, which `StickySessionRoutingStrategy` guarantees (the alphabet_sort recipes use it; the router default stays `LeastLoadedRoutingStrategy`, as on main). Under any strategy the salt is still correct: a turn that lands elsewhere pins that generator's version and misses the cache. | Request | Salt | Why | | --- | --- | --- | | 1st turn of a rollout | The generator's installed version | Pins the rollout; it cannot hit KV from older weights. | | Later turn on the rollout's generator | The rollout's pin | **Each turn** extends the previous one, so the conversation history stays reusable across policy updates. | | (Corner case) Later turn rerouted to another generator | That generator's installed version | The history KV stays on the old generator; the destination has no pin for the rollout. | **Why key by rollout, not by group.** Routing places rollouts, not groups: `StickySessionRoutingStrategy` keeps a rollout's turns on one generator by `routing_session_id` and spreads new rollouts by load, so siblings of a group may land on different generators and never share KV there anyway. Keying by rollout matches the routing unit and keeps staleness tight: a sibling first admitted after a pull pins the new version instead of inheriting its group's older one. The cost is that such a late sibling re-prefills the group prompt, which is short next to multi-turn history. **When pins are dropped.** A generator cannot tell a finished rollout from one between turns (env steps, tool calls), so time- or idle-based pruning would drop a long rollout's pin and force a re-prefill. Only the controller knows when a group has no more calls: each `GenerateFn` call carries its `group_id`, and after a group finishes the controller calls the new `release_groups` router endpoint, which fans out to every generator. Validation group ids are reused every validation, so they are released too. **Why a policy version rather than a rollout id as the salt.** Only a weight change makes cached KV stale, so the namespace only needs to change with the version. A per-rollout salt would give every rollout a private namespace and lose prefix reuse across rollouts, such as a shared system prompt or tool definitions. A version salt keeps that reuse while walling off KV from older policies. <img width="2500" height="2722" alt="image" src="https://github.com/user-attachments/assets/8e597514-7941-481a-9801-5d31046e1898" /> ## DAPO Math performance measurement Compared this PR's default (`reset_kv_cache_on_weight_sync=false`), this PR with the reset flag (`true`), and `main` (`46ec3f232`, which resets the prefix cache and running requests on every weight sync). ### Setup - `rl_dapo_qwen3_4b_math_8k`, Qwen3-4B-Base BF16, single-turn - 4x H100: TP2 trainer plus two TP1 generators, `LeastLoadedRoutingStrategy` - 10 optimizer steps; 8 prompt groups/step; 16 completions/prompt - 2,048-token prompt and 8,192-token response limits - Same checkpoint, config, seeds, and hardware; one run per mode vLLM metrics come from the engine stat logger, summed over both generators, over steps 2-10 (from the step 1 log to the step 10 log, excluding validation). Request E2E is vLLM `last_token_ts - queued_ts`. | Metric | This PR, preserve (default) | This PR, reset | main | | --- | ---: | ---: | ---: | | Preempted requests | **0** | 687 | 858 | | Queue latency mean | **0.86 ms** | 52.4 ms | 61.6 ms | | Time to first token mean | **34.8 ms** | 93.6 ms | 103.6 ms | | Prefill time mean | **32.5 ms** | 37.4 ms | 37.2 ms | | Request E2E mean | 18,916 ms | 20,015 ms | 20,179 ms | | Inter-token latency mean | 19.18 ms | 19.62 ms | 20.43 ms | | Prefix-cache hit rate | 85.44% | 85.27% | 85.57% | | Generation throughput | 5,339 tok/s | 5,146 tok/s | 5,722 tok/s | | Wall time, steps 2-10 | 388.5 s | 391.0 s | 367.2 s | Preserving KV removes every preemption at weight sync, which cuts queue latency by about 98% and time to first token by about 65%. The reset mode matches `main`. End-to-end metrics are within run-to-run noise: reset and `main` behave the same yet differ by 10% in throughput, so these runs support no throughput claim. DAPO is single-turn, so the gain is limited to the avoided re-prefill of in-flight requests; multi-turn rollouts, which lose their whole conversation history on a reset, are where preserving KV should matter most. ## Test plan - Generator engine loop: a rollout's later turn keeps its pinned salt across a weight sync while a new rollout of the same group pins the new version; `release_groups` drops a group's pins (and ignores unknown groups), so a reused group id pins the current version. - Generator: admission passes the pinned version as `cache_salt`; `min_policy_version` is the pinned version; the reset flag controls the cache reset and clears pins only when set; `batch_invariant` requires the reset. - Verifiers: the shared generation server forwards each request's group id; requests without a group id get 400. - `pytest tests/rl/unit_tests/cpu/`: 458 passed, 3 skipped, 0 failed.
Base automatically changed from
bahuang/graph_trainer_spmd_ga_config
to
bahuang/graph_trainer_single_config
October 1, 2026 21:31
SherlockNoMad
force-pushed
the
bahuang/graph_trainer_drop_spmd_schedule_mode
branch
from
October 1, 2026 21:31
d5d1f84 to
78beb65
Compare
aditvenk
approved these changes
Oct 1, 2026
## Summary - remove TorchTitan-owned Float8 rowwise dense and grouped-expert implementations - remove the corresponding converters, model recipes, integration coverage, and documentation - retain MXFP8, NVFP4 checkpoint compatibility ## Why Float8 tensorwise and rowwise recipes depend on model compilation for competitive performance and are no longer widely used. Removing them keeps the supported low-precision surface focused on the formats still in active use. Context: #4895 (comment) ## Testing - `SKIP=pyrefly-check pre-commit run --all-files` - 19 config, integration-definition, and CLI tests passed - 24 LoRA tests passed (one unrelated CPU FlexAttention test excluded) - 11 quantization tests passed and 37 skipped (four existing MXFP8 tests requiring torchao nightly excluded)
## Summary - Compile `CosSinRoPE.forward` as the default `cos_sin_rope` local compile region. - Cover Qwen3.5/Qwen3.8 `MRoPE` through its inherited `CosSinRoPE.forward`. - Keep `ComplexRoPE` eager because Inductor does not efficiently lower complex operators. - Keep both Helion overrides because the faster cos/sin implementation depends on shape and Helion is substantially faster for complex RoPE. This PR is stacked on #4931. ## Performance One NVIDIA H100 with BF16 inputs. Forward+backward includes query and key gradients. Each result is the median of five trials with 20 warmup iterations and 100 timed iterations per trial. Compilation time is excluded. Shape is `[T, Hq, Hkv, D]`, where `T` is the rank-local token count after packing and `Hq`/`Hkv` are rank-local heads after TP. A speedup above `1.0x` means local compile is faster. ### CosSinRoPE The exact Helion cos/sin override applies to these models. | Workload | Shape | Eager | Helion | Local compile | Speedup vs eager | Speedup vs Helion | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Qwen3 0.6B RL TP2 | `[4096, 8, 4, 128]` | 409.27 us | 472.09 us | 250.63 us | **1.63x** | **1.88x** | | Qwen3 8B SFT TP1 | `[40960, 32, 8, 128]` | 12.92 ms | 854.86 us | 901.50 us | **14.33x** | **0.95x** | | Qwen3 14B TP1 | `[163840, 40, 8, 128]` | 61.26 ms | 3.95 ms | 4.34 ms | **14.12x** | **0.91x** | | Qwen3 30B-A3B RL TP2 | `[4096, 16, 2, 128]` | 634.79 us | 503.01 us | 295.81 us | **2.15x** | **1.70x** | | Qwen3 32B TP1 | `[81920, 64, 8, 128]` | 45.93 ms | 2.95 ms | 3.21 ms | **14.33x** | **0.92x** | | GPT-OSS 20B RL TP2 | `[4096, 32, 4, 64]` | 632.31 us | 458.05 us | 265.19 us | **2.38x** | **1.73x** | Local compile is faster than eager for all tested shapes and faster than Helion for three of six. Helion remains 1.05x, 1.10x, and 1.09x faster for the Qwen3 8B, 14B, and 32B shapes, respectively. ### MRoPE `MRoPE` inherits the locally compiled `CosSinRoPE.forward` and specializes cache construction for three-axis positions. The Helion override targets exactly `CosSinRoPE.Config`, so it does not replace `MRoPE.Config`. | Workload | Positions | Shape | Eager | Local compile | Speedup vs eager | | --- | ---: | ---: | ---: | ---: | ---: | | Qwen3.5 9B RL TP2 text | `[T]` | `[2048, 8, 2, 64]` | 413.46 us | 180.22 us | **2.29x** | | Qwen3.5 9B TP2 three-axis | `[T, 3]` | `[2048, 8, 2, 64]` | 670.32 us | 226.58 us | **2.96x** | | Qwen3.5 27B RL TP2 text | `[T]` | `[65536, 12, 2, 64]` | 3.78 ms | 299.47 us | **12.62x** | | Qwen3.5 27B TP2 three-axis | `[T, 3]` | `[65536, 12, 2, 64]` | 4.02 ms | 368.85 us | **10.89x** | | Qwen3.8 2.4T-A95B TP4 text | `[T]` | `[262144, 16, 1, 64]` | 17.74 ms | 1.35 ms | **13.12x** | | Qwen3.8 27B TP4 three-axis | `[T, 3]` | `[1048576, 6, 1, 64]` | 32.59 ms | 4.27 ms | **7.63x** | Local compile is faster than eager for all tested MRoPE text and three-axis shapes. ### Complex RoPE exclusion DeepSeek V3 recipes use four packed 16K sequences per DP rank, so `T = 65536`. The 16B model has 16 query heads; the 236B and 671B models have 128. All use one MLA RoPE key head and `D = 64`. | Workload | Shape | Eager | Helion | Local compile | Speedup vs eager | Speedup vs Helion | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | DeepSeek V3 16B | `[65536, 16, 1, 64]` | 1.50 ms | 345.38 us | 1.40 ms | **1.07x** | **0.25x** | | DeepSeek V3 236B/671B | `[65536, 128, 1, 64]` | 10.47 ms | 2.17 ms | 9.94 ms | **1.05x** | **0.22x** | Inductor warns that complex-operator code generation is unsupported. Exploratory local compile is only 1.05-1.07x faster than eager, while Helion is 4.06-4.57x faster on the DeepSeek V3 shapes. Therefore this PR leaves `ComplexRoPE` eager and retains the Helion override. These are isolated operator measurements, not end-to-end training results. ## Correctness - Cos/sin RoPE and Qwen3.5/Qwen3.8 MRoPE compiled forward and backward are bitwise identical to eager. - Cos/sin RoPE compiled forward and backward is batch invariant. ## Tests ```text pytest -q tests/unit_tests/cpu/test_compile_config.py tests/unit_tests/cpu/test_offset_rmsnorm.py tests/unit_tests/cpu/test_rope.py tests/unit_tests/gpu/test_offset_rmsnorm.py tests/unit_tests/gpu/test_swiglu.py tests/unit_tests/gpu/test_rope_compile.py tests/unit_tests/gpu/test_helion_rope.py 63 passed, 5 subtests passed pyrefly check <changed files> --summarize-errors No errors found ```
Stage generator weights into persistent pinned CPU DTensor buffers so RDMA can overlap generation. The engine-loop update then performs the shorter CPU-to-GPU copy. This feature is behind a flag which is enabled by default. Therefore, we also disable CuMem allocator by default because we don't transfer to GPU memory anymore using RDMA in this mode. <!-- forkstack:stack:start --> --- Stack (top to bottom): - -> #4945 [rl] Stage generator weights in CPU memory --- <!-- forkstack:stack:end --> Co-authored-by: Tushar Jain <[email protected]>
## Summary - Add function-scoped local compilation for the Kimi K3 SiTUGLU activation. - Enable the situglu local-compile target by default. - Cover dense execution and the grouped-expert call path that passes offsets. - Stack on #4985. ## Performance Steady-state BF16 operator latency on one H100 with Kimi K3 beta=4 and linear_beta=25. Compilation time is excluded. Results are the average of two independent run medians; each run used five measurements after warmup. Shapes use the released Kimi K3 hidden dimensions with representative TP8/EP8 layouts. Routed-expert rows assume balanced top-k=16 routing across EP8. | Path | Rank-local shape | Eager fwd | Local compile fwd | Speedup | Eager fwd+bwd | Local compile fwd+bwd | Speedup | | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | Dense, 4K tokens, TP8 | [512, 4224] | 79.65 us | 13.07 us | 6.09x | 189.29 us | 76.17 us | 2.49x | | Dense, 32K tokens, TP8 | [4096, 4224] | 850.16 us | 54.15 us | 15.70x | 2.074 ms | 137.29 us | 15.11x | | Shared experts, 4K tokens, TP8 | [512, 768] | 43.63 us | 7.45 us | 5.85x | 188.14 us | 76.03 us | 2.47x | | Shared experts, 32K tokens, TP8 | [4096, 768] | 120.50 us | 16.40 us | 7.35x | 295.94 us | 77.56 us | 3.82x | | Routed experts, 4K tokens, EP8 | [8192, 3072] | 1.208 ms | 86.69 us | 13.93x | 2.943 ms | 205.78 us | 14.30x | | Routed experts, 32K tokens, EP8 | [65536, 3072] | 9.204 ms | 621.20 us | 14.82x | 22.555 ms | 1.561 ms | 14.45x | Local compile is faster for every tested shape. These isolated operator results do not claim the same end-to-end training speedup. The routed path still evaluates the full padded buffer because SiTUGLU does not consume offsets. ## Testing - pytest -q tests/unit_tests/cpu/test_compile_config.py tests/unit_tests/cpu/test_feed_forward.py tests/unit_tests/cpu/test_moe.py (32 passed, 9 subtests passed) - pytest -q tests/unit_tests/gpu/test_situglu.py (3 passed) - Verified compiled forward and backward emit Triton code. - Verified forward, gate gradient, and up gradient match the eager reference. - Verified compiled forward and both input gradients are bitwise batch-invariant.
model_config_to_hf_config_dict set eos_token_id=1 (and bos_token_id=0) as placeholders, assuming vLLM never reads them. When the checkpoint has no generation_config.json (e.g. Qwen3.5-9B), vLLM builds the generation config from this HF config and adds its eos_token_id to every request's stop set. Token 1 is `"` in the Qwen vocab, so every sampled double quote ended the completion: Terminal-Bench turns stopped after a few tokens, at the first quote, with no </think> or tool call. Leave both ids unset; vLLM takes EOS from the tokenizer and callers pass any other stop tokens. Test: new CPU test fails before (eos_token_id == 1) and passes after. TorchTitan VLLMGenerator on Qwen3.5-9B, a Terminal-Bench prompt, 16 seeds: before, every completion stops at the closing quote after 13-16 tokens; after, 212-344 tokens with full reasoning, matching stock vLLM.
…nfig (#5005) Replaces #4997, which was merged into its stacked base branch (`bahuang/graph_trainer_single_config`) instead of `main`. Rebased onto `main` now that #4983 has landed; same single commit. ## Why - `fsdp_param_unshard_mode`, `fsdp_gradient_sync_mode` and `gradient_accum_in_wgrad_fusion` only make sense for users running SPMD (PP=1) with gradient accumulation. - This simplifies the mental model for SPMD with GA and for PP>1: - **SPMD without GA:** FSDP collectives always stay in the graph, so there is nothing to configure. - **PP>1:** FSDP collectives are always extracted as `UNSHARD` / `REDUCE_GRAD` schedule actions, so there is nothing to configure. Before this PR, every user saw these settings at the top level of `GraphTrainerCompileConfig`, with `auto` values and per-mode caveats like "PP>1: error". ## What - New `compile.spmd_gradient_accumulation: SPMDGradientAccumulationConfig` with three fields: | Old (`compile.*`) | New (`compile.spmd_gradient_accumulation.*`) | Values | |---|---|---| | `fsdp_param_unshard_mode` | `fsdp_param_unshard_mode` | `every_microbatch`, `first_microbatch` (default), `schedule` | | `fsdp_gradient_sync_mode` | `fsdp_grad_reduce_mode` | `every_microbatch`, `last_microbatch` (default), `schedule` | | `gradient_accum_in_wgrad_fusion` | `fuse_wgrad_accumulation` | `auto` (default), `disabled`, `enabled` | `auto` is gone from the FSDP modes. `only_in_first_microbatch` / `only_in_last_microbatch` become `first_microbatch` / `last_microbatch`, and `extracted_in_schedule_stage` / `deferred_as_schedule_stage` become `schedule`. - **Ignored instead of raising:** outside SPMD with GA (PP>1, or a single microbatch), non-default settings are ignored with a warning. The FSDP fields are also ignored when FSDP is disabled. Wgrad fusion still applies without FSDP. - **Parameter reuse implies no resharding:** `first_microbatch` and `schedule` unsharding reuse unsharded parameters across microbatches, so they now imply `fsdp_reshard_after_forward=never` for the compiled graphs. Before, the defaults raised an error with FSDP unless the user set that flag manually. - `GraphExecutionPlan.reuse_unsharded_parameters` becomes a derived property. - The runtime schedule adds one `RESHARD` at the end of the step. - Explicitly setting `fsdp_reshard_after_forward="always"` together with these modes logs a warning. - The FSDP wgrad-fusion error now says `fsdp_grad_reduce_mode` must be `'last_microbatch' or 'schedule'`. Before, it named only `'schedule'`, though the check accepts both. ## Behavior changes - **Old field names:** recipes that set the old `compile.*` fields need to move to `compile.spmd_gradient_accumulation.*`. No in-repo recipes used them other than the integration tests, which are updated here. - **Errors become warnings:** with PP>1 or a single microbatch, `fuse_wgrad_accumulation="enabled"` or non-default FSDP modes now log a warning instead of raising. - **Integration jobs take a new code path:** the CI integration jobs that use extracted (`schedule`) unsharding now reuse unsharded parameters across microbatches, instead of running `UNSHARD`/`RESHARD` per microbatch. ## Test plan - **`test_graph_pp_runner.py` passes (58 tests).** New and updated tests cover: - parameter reuse forcing `reshard_after_forward=never` - the ignored-config warnings for PP>1, GA=1 and no FSDP - wgrad fusion without FSDP - the FSDP split-reduction error - **Full graph_trainer unit suite:** 444 passed, 24 failed. The same 24 fail on the base commit locally because of environment issues: cudnn `disable_global_flags`, missing `autoparallel`, and an Inductor config key. `test_autoparallel_integration_matrix` was excluded because `torchvision` isn't installed. - **Not yet run:** GPU integration tests and a loss comparison. - **Gap:** the default (`first_microbatch`, `last_microbatch`) FSDP path has no GPU integration coverage yet. - `pre-commit` clean (pyrefly skipped locally). - After rebasing onto `main`: `test_graph_pp_runner.py` and `test_graph_pp_passes.py` pass (105), pre-commit clean, and a 10-step 1-GPU SPMD GA run matches the pre-rebase loss (step 1 8.11272, step 10 4.03365).
Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.15.0) (oldest at bottom): * #4662 * __->__ #4661 Allow multi-stage pipeline schedules to overlap an FSDP gradient reduction wait with the next local stage backward. Single-stage schedules cannot place work between reduction and wait, so they reject the option. This uses the `defer_reduce_grad_wait` API from PyTorch PR, pytorch/pytorch#196963. This PR also changes TorchTitan's CI to use PyTorch cu132 as we no longer have cu130 wheel.
## Summary `ParallelismContext._validate` used `assert` to reject a bad parallelism recipe. That is the wrong tool for user-facing config: - `python -O` (and `-OO`) strips `assert`. A zero degree then hits `ZeroDivisionError` while auto-filling `dp_shard=-1`, or the product check disappears and `dp_shard` is left truncated so it no longer multiplies out to `world_size`. - The expert-parallel check immediately below already raises `ValueError` when `ep` does not divide `dp_shard * cp * tp`. Degree checks should fail the same way. Those degree checks now raise `ValueError` with the same rules: - `dp_replicate`, `cp`, `tp`, `pp`, and `ep` must be `>= 1`. - `dp_shard` must be `-1` or `>= 1`. `dp_shard=-1` still auto-fills as `world_size // (dp_replicate * cp * tp * pp)`, and the filled value must be `>= 1`. - `dp_replicate * dp_shard * cp * tp * pp` must equal `world_size`. Mesh construction, the expert-parallel rule, and the world-size formula are unchanged. Expert parallel is not a factor of `world_size`. ## Test plan - [ ] `python -m pytest tests/unit_tests/cpu/test_parallelism_context.py -q --tb=line` - `test_validation_invalid_world_size`, `test_validation_zero_parallelism`, and `test_validation_invalid_dp_shard` expect `ValueError` and the message names the bad condition (world size mismatch, degree `>= 1`, `dp_shard`). - `test_auto_calculate_dp_shard` still accepts `dp_shard=-1`. CI has not been run for this branch.
Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.15.0) (oldest at bottom): * __->__ #4662 * #4661 **Summary** Expose the maximum number of pending pipeline send batches. The PyTorch schedule inserts explicit waits and releases sent outputs while autograd keeps the backward edges. Unit tests cover forwarding and validation. A deterministic FSDP 2 x PP 2 integration case covers the budget with deferred gradient-reduction waits. This PR depends on pytorch/pytorch#196727
## Summary Override examples still tell users to run `torchtitan_train`. That Tyro-era command is gone after the config loader: it is not a script, entry point, or module, so copy-pasting those examples fails today. The real entry is `python -m torchtitan.train`, with the same `--module`, `--config`, and `--override` flags, including the quoted JSON override form. ## Test plan - [ ] Read `torchtitan/config/OVERRIDE.md` and `torchtitan_recipes/overrides/helion_rope.py`. The examples invoke `python -m torchtitan.train`.
The custom MXFP8 example in `torchtitan/models/flux/README.md` cannot be copied. It assigns `config.model_converters = ModelConvertersContainer.Config(...)`, but `ModelConvertersContainer` is not defined, so that line raises `NameError`. `Trainer.Config` and `FluxTrainer.Config` also have no `model_converters` attribute, so the assignment would raise `AttributeError` even if the name existed. `flux_schnell_mxfp8` and `flux_dev_mxfp8` do not use that API. `_enable_mxfp8` in `torchtitan_recipes/models/flux.py` rebuilds the model with `build_model_config(flavor, converters=[MXFP8LinearConverter.Config(fqns=[...])])`. `build_model_config` in `torchtitan/models/flux/flavors.py` takes `converters`, not `quantization` or `model_converters`. The example now does the same assignment, imports the names it uses, and keeps the recipe FQNs: `double_blocks`, `single_blocks`, `img_in`, `txt_in`, `time_in`, `vector_in`, and `final_layer`. ## Test plan - [ ] `/tmp/ttenv/bin/python -m pytest tests/unit_tests/cpu/test_flux_mxfp8_readme.py -q`
## Summary - Make the manual Moonshot BF16 forward-parity diagnostic reproducible with a pinned Hugging Face revision, seed 42, deterministic algorithms, and the eager reference attention backend. Reference dependency versions are documented, not enforced at runtime. - Adapt the diagnostic to the current Kimi K3 config structure and retain the released vocabulary IDs while reducing the architecture to the current `debugmodel` dimensions. - Reuse the existing `kimi_k3_debugmodel_mm_muon` B200 integration test as a 10-step loss/gradient-norm regression; this PR adds no new training recipe. - Document the existing Kimi K3 TP/SP, EP, PP, and VPP support and B200 coverage. - Leave the existing KDA unit-test coverage unchanged from `main`. ## Why Kimi K3 had training smoke coverage but no checked-in, architecture-specific loss/gradient-norm trace. This change makes the existing 2-GPU FSDP2/EP2 DistMuon run detect numerical drift through `scripts/loss_compare.py` without adding another nearly identical test configuration. The one-GPU model-only seed checkpoint uses the existing AdamW `kimi_k3_debugmodel_mm` recipe because DistMuon requires DTensor parameters. The measured 10-step run still uses `kimi_k3_debugmodel_mm_muon`; the seed recipe only initializes the shared model state. The Moonshot comparison remains a manual diagnostic rather than CI. CI drift detection comes from the B200 golden. ## Moonshot BF16 parity The pinned diagnostic was run twice on one GB300 GPU with identical results: - Hugging Face revision: `9f62e4e9fffbd0a83ddd60e1c209d828994b3569` - Pixel preprocessing max difference: `1.192e-07` - Projected vision features: cosine `0.999987`, max difference `3.125e-02` - MoE routes: `5230/5248` match (`99.7%`) - Final logits: KL `1.0212e-05`, cosine `0.999968`, max difference `1.5625e-02` - Top-1 and top-5: `100%` match ## B200 golden - Config: `kimi_k3_debugmodel_mm_muon` - Parallelism: FSDP2 + EP2 on 2 B200 GPUs - Metrics: full-precision TensorBoard `loss` and `grad_norm`, 10 steps - Determinism: seed 42 with deterministic algorithms enabled by `loss_compare.py` - Export: [B200 run 36969900518](https://github.com/pytorch/torchtitan/actions/runs/36969900518) - Golden SHA-256: `358b64b64f4f649b14d943b78e860af79fea028181b108d8eba4bd65745d39d8` - Independent import/assert: [B200 run 36971319111](https://github.com/pytorch/torchtitan/actions/runs/36971319111) ## Validation - Two local GB300 Moonshot runs completed with identical metrics. - The B200 export produced the checked-in trace; an independent B200 run extracted all 10 steps and passed exact equality for both loss and gradient norm. - `tests/unit_tests/cpu/test_integration_test_definitions.py`: 17 passed. - PR-scoped formatting, lint, and documentation hooks pass; targeted Pyrefly reports zero errors.
`GarbageCollection.__init__` rejected a non-positive `gc_freq` with `assert`. `training.gc_freq` is user config. That assert disappears under `python -O`, and `gc_freq=0` then dies as `ZeroDivisionError` on `step_count % self.gc_freq` during training. A negative value still collects. Raise `ValueError` in the constructor instead. The message includes the bad value and says `training.gc_freq` must be a positive integer. The default stays 1000, and when GC runs is unchanged. The check stays in the constructor (not `TrainingEngine` or `configs.py`) because #4907 rewrites the config layout. ## Test plan - [ ] `pytest tests/unit_tests/cpu/test_gc_freq.py -q` - [ ] `GarbageCollection(0)` and `GarbageCollection(-1)` raise `ValueError` whose message mentions `gc_freq` - [ ] `GarbageCollection(1)` and `GarbageCollection(1000)` still construct, and periodic collection still runs only when `step_count > 1` and `step_count % gc_freq == 0`
…4842) 1. E.g. we have joint graph: ```python before = sin(x) mutation = x.copy_(before) # Mutation return is unused. forward = cos(x) # forward = cos(sin(x0)) backward = before * 2 # backward = 2 * sin(x) ``` Current partitioner: ```python saved = find_saved_values(forward_outputs, backward_outputs) mutations = find_forward_mutations() ``` ``` saved = [x] mutations = [mutation] ``` FWD: ```python before = sin(x) mutation = x.copy_(before) forward = cos(x) return forward, x, mutation # ``` BWD: ```python # x_saved already contains sin(original_x) before = sin(x_saved) backward = before * 2 ``` Backward therefore uses `sin(sin(original_x))` - WRONG The Fix: Add sources of mutations into lookup of values to be saved , to cut the recomputation chains at them. Then the old logic will check, that it is used by forward and by backward and save it. In this case sin(x) will not be replayed. So the main semantic that we add: We save forward mutation sources if they are used by backward too. This makes the recompute cat to be after this points, without rereplaying ops on them. Implementation: Extracted all mutation related utilities to torchtitan/experiments/graph_trainer/mutation_utils.py Removed all positional assumptions to use schema based mutation analysis.
…tion fsdp_param_unshard_mode="schedule" and fsdp_grad_reduce_mode="schedule" extracted FSDP all-gather / reduce-scatter out of the PP=1 joint graph into standalone UNSHARD / REDUCE_GRAD schedule actions. For PP=1 there is only one stage, so tracking these collectives as separate schedule actions adds no scheduling freedom over keeping them inside the first/last (or every) microbatch graph, while costing a lot of machinery. Remove the option. PP>1 still always uses scheduled UNSHARD / REDUCE_GRAD. The remaining PP=1 combinations are: - (every_microbatch, every_microbatch): FULL_FORWARD_BACKWARD per microbatch - (first_microbatch, last_microbatch): FIRST_WITH_UNSHARD, FORWARD_BACKWARD, LAST_WITH_REDUCE_GRAD, then RESHARD Mixed combinations are rejected. Simplifications this enables: - Remove FORWARD_BACKWARD_REPEAT_WITH_UNSHARD / _REDUCE_GRAD computation types, joint_forward_backward_computation_type and its lookup table. - Remove PP=1 extraction of standalone UNSHARD / REDUCE_GRAD graphs, their merge passes, annotation/compilation, and _compile_optional_graph. - Drop GraphExecutionPlan.requires_graph_extraction (use has_gradient_accumulation) and the duplicated precompile check. - PP=1 runtime schedule only emits per-microbatch actions plus RESHARD. - Remove the runtime branch deciding whether grad reduction ran in the joint graph. Tests: replace the three "schedule" integration jobs with one covering the default (first_microbatch, last_microbatch) FSDP path, and update unit tests.
SherlockNoMad
force-pushed
the
bahuang/graph_trainer_drop_spmd_schedule_mode
branch
from
October 2, 2026 17:16
78beb65 to
60decf6
Compare
SherlockNoMad
requested review from
fegin,
felipemello1,
pzhan9,
wconstab and
wwwjn
as code owners
October 2, 2026 17:16
SherlockNoMad
added a commit
that referenced
this pull request
Oct 2, 2026
…tion (#5024) Replaces #4998, whose stacked base branch was merged and can no longer be retargeted. Rebased onto `main` now that #5005 (the SPMD gradient accumulation config) has landed; same single commit. ## Why `fsdp_param_unshard_mode="schedule"` / `fsdp_grad_reduce_mode="schedule"` extracted FSDP all-gather / reduce-scatter out of the PP=1 joint graph into standalone `UNSHARD` / `REDUCE_GRAD` schedule actions. With PP=1 there is a single stage, so tracking these collectives as separate schedule actions gives no scheduling benefit over keeping them inside the first/last (or every) microbatch graph -- but it required a lot of extra machinery (mixed REPEAT computation types, extra extracted graphs, merge/compile paths, runtime branches). PP>1 is unchanged and still always uses scheduled `UNSHARD` / `REDUCE_GRAD`. ## What Remaining PP=1 + GA combinations: - `(every_microbatch, every_microbatch)`: `FULL_FORWARD_BACKWARD` per microbatch - `(first_microbatch, last_microbatch)` (default): `FIRST_WITH_UNSHARD`, `FORWARD_BACKWARD`, `LAST_WITH_REDUCE_GRAD`, then `RESHARD` - Mixed combinations are rejected with a `ValueError`. Removed: - `FORWARD_BACKWARD_REPEAT_WITH_UNSHARD` / `FORWARD_BACKWARD_REPEAT_WITH_REDUCE_GRAD`, `joint_forward_backward_computation_type` and its lookup table - PP=1 extraction of standalone UNSHARD / REDUCE_GRAD graphs, their merge passes, annotation/compilation, `_compile_optional_graph` - `GraphExecutionPlan.requires_graph_extraction` (replaced by `has_gradient_accumulation`) and a duplicated precompile check - PP=1 `UNSHARD` / `REDUCE_GRAD` schedule actions (schedule is now per-microbatch actions + `RESHARD`) - Runtime branch deciding whether grad reduction ran inside the joint graph Net: +99 / -419. ## Tests - `test_graph_pp_runner.py`, `test_graph_pp_passes.py`, `test_trace_module.py`: 162 passed, 3 skipped. - Replaced the three `"schedule"` integration jobs with `aot_fx_trace_llama3_ga_first_unshard_last_reduce_fsdp` (default FSDP GA path had no coverage). - Ran both remaining FSDP=4 + GA configs for 10 steps on 4 GPUs with `seed=42`, `deterministic=True`; both modes produce identical loss/grad_norm (stdout precision): | mode | step 1 loss | step 10 loss | step 10 grad_norm | |---|---|---|---| | first/last | 8.14194 | 3.99857 | 1.9983 | | every/every | 8.14194 | 3.99857 | 1.9983 | **After rebasing onto `main`:** one import conflict in `test_graph_pp_runner.py` (kept `WAIT_REDUCE_GRAD` from #4662, dropped the now-unused `UNSHARD`). pre-commit and pyflakes are clean. The unit tests above were run before the rebase; they could not be re-run locally because current `main` imports `WAIT_REDUCE_GRAD` (#4662), which needs a newer PyTorch than the local build. Relying on CI for the post-rebase run.
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.
Stacked on #4997.
Why
fsdp_param_unshard_mode="schedule"/fsdp_grad_reduce_mode="schedule"extracted FSDP all-gather / reduce-scatter out of the PP=1 joint graph into standaloneUNSHARD/REDUCE_GRADschedule actions. With PP=1 there is a single stage, so tracking these collectives as separate schedule actions gives no scheduling benefit over keeping them inside the first/last (or every) microbatch graph -- but it required a lot of extra machinery (mixed REPEAT computation types, extra extracted graphs, merge/compile paths, runtime branches).PP>1 is unchanged and still always uses scheduled
UNSHARD/REDUCE_GRAD.What
Remaining PP=1 + GA combinations:
(every_microbatch, every_microbatch):FULL_FORWARD_BACKWARDper microbatch(first_microbatch, last_microbatch)(default):FIRST_WITH_UNSHARD,FORWARD_BACKWARD,LAST_WITH_REDUCE_GRAD, thenRESHARDValueError.Removed:
FORWARD_BACKWARD_REPEAT_WITH_UNSHARD/FORWARD_BACKWARD_REPEAT_WITH_REDUCE_GRAD,joint_forward_backward_computation_typeand its lookup table_compile_optional_graphGraphExecutionPlan.requires_graph_extraction(replaced byhas_gradient_accumulation) and a duplicated precompile checkUNSHARD/REDUCE_GRADschedule actions (schedule is now per-microbatch actions +RESHARD)Net: +99 / -419.
Tests
test_graph_pp_runner.py,test_graph_pp_passes.py,test_trace_module.py: 162 passed, 3 skipped."schedule"integration jobs withaot_fx_trace_llama3_ga_first_unshard_last_reduce_fsdp(default FSDP GA path had no coverage).seed=42,deterministic=True; both modes produce identical loss/grad_norm (stdout precision):