Skip to content

Revert "[training, perf] fix: THD-aware FLOPS via cu_seqlens (Σᵢ sᵢ²) (#3839)" - #4363

Merged
yaoyu-33 merged 1 commit into
mainfrom
chcui/revert-3839
Jun 15, 2026
Merged

Revert "[training, perf] fix: THD-aware FLOPS via cu_seqlens (Σᵢ sᵢ²) (#3839)"#4363
yaoyu-33 merged 1 commit into
mainfrom
chcui/revert-3839

Conversation

@cuichenx

Copy link
Copy Markdown
Contributor

Reverts #3839.

#3839 was merged accidentally while its CI was still red. The test_sft_example_runs_with_cp_and_packing (CP=2, packed SQuAD) functional test in L0_Launch_training hangs into an NCCL watchdog timeout (WorkNCCL(... OpType=ALLREDUCE, NumelIn=1 ...) Timeout(ms)=600000) after ~20 min. The hang reproduces only on #3839 across the recent CI window (every other branch passes the CP test) and is still under investigation — a faithful repro on cw-dfw (matching the CI mcore pin de6305c0) is pending.

This revert restores main to a known-good state. #3839 will be re-opened with a fix once the CP-test hang is root-caused.

🤖 Generated with Claude Code

…#3839)"

This reverts commit 7b1dc37 (PR #3839).

#3839 was merged accidentally while its CI was still red: the
`test_sft_example_runs_with_cp_and_packing` (CP=2) functional test hangs
into an NCCL watchdog timeout (600s) on the GitHub Actions runners. The
hang reproduces only on #3839 and is still under investigation. Reverting
to restore main to a known-good state; #3839 will be re-opened with a fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
@yaoyu-33
yaoyu-33 merged commit 4a2c844 into main Jun 15, 2026
17 checks passed
@yaoyu-33
yaoyu-33 deleted the chcui/revert-3839 branch June 15, 2026 18:16
@claude

claude Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Light Code Review -- Clean revert of PR 3839. The removed functions and their tests are consistently deleted across all call sites. The functional test test_seqpacking_cp_example is restored to its pre-3839 configuration. -- Observations -- VPP/dp_size ordering inconsistency for num_vision_patches (pre-existing, not introduced by this revert): train.py (line ~566) VPP-divides first then multiplies by dp_size, while train_utils.py (line ~535-541) multiplies by dp_size first then VPP-divides. With integer division these are not equivalent. Worth consolidating when 3839 is re-landed. -- .item() GPU-to-CPU sync in vlm_step.py (also pre-existing): the reverted grid.prod(dim=-1).sum().item() call forces a device sync per micro-batch. Another thing to address on re-land. -- No critical bugs or logic errors introduced by this revert. -- Suggested test cases -- No perf tests impacted.

@claude

claude Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Light Code Review

Clean revert of 3839. The removed functions and their tests are consistently deleted across all call sites. The functional test test_seqpacking_cp_example is restored to its pre-3839 configuration.

Observations

VPP/dp_size ordering inconsistency for num_vision_patches (pre-existing, not introduced by this revert):

  • train.py (line ~566): VPP-divides first, then multiplies by dp_size: (local // vp_size) * dp_size
  • train_utils.py (line ~535-541): multiplies by dp_size first, then VPP-divides: (local * dp_size) // vp_size

With integer division these are not equivalent (e.g. (3 // 2) * 4 = 4 vs (3 * 4) // 2 = 6). In practice VLM + VPP is rare and vision patch counts are typically divisible, so unlikely to bite today. Worth consolidating when 3839 is re-landed.

.item() GPU-to-CPU sync in vlm_step.py (also pre-existing): the reverted grid.prod(dim=-1).sum().item() call in forward_step forces a device sync per micro-batch for VLM vision-patch counting. Another thing to address on re-land.

No critical bugs or logic errors introduced by this revert.

Suggested test cases

No perf tests impacted.

cuichenx added a commit that referenced this pull request Jun 16, 2026
…d of #3839)

Re-applies #3839 (reverted in #4363 after an accidental merge) with one fix.

#3839's last commit added `cfg.checkpoint.load = None` to the CP+packing
functional test (test_sft_example_runs_with_cp_and_packing). With
pretrained_checkpoint also None, finetune() then fails its precondition
(finetune.py:50) with "Finetuning requires a loading from a pretrained
checkpoint or resuming from a checkpoint". This drops that line, restoring
the pre-#3839 behavior (inherit the recipe's default load) so the test runs.

The `use_distributed_optimizer=False` setting added to that test is kept:
it works around an NCCL watchdog hang seen only under the distributed
optimizer + context parallelism in this test (root-cause tracked separately;
the THD-FLOPS code itself is inert under CP>1, taking the BSHD fallback).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
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.

2 participants