Skip to content

Enable MFSDP v2 recompute weight planes in the MCore adapter - #8803

Closed
shjwudp wants to merge 7 commits into
NVIDIA:pull-request/8432from
shjwudp:fix/mfsdp-v2-recompute-adapter
Closed

shjwudp wants to merge 7 commits into
NVIDIA:pull-request/8432from
shjwudp:fix/mfsdp-v2-recompute-adapter

Conversation

@shjwudp

@shjwudp shjwudp commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Enable #8432's backward-plane policy in the MCore adapter when MXFP8 parameter gathering and activation recomputation are configured. Selective MLA and root-owned MTP recomputation can invoke child modules without re-entering their owning FSDP unit, so backward must also make the forward weight representation available.

Depends on #8432; this PR targets pull-request/8432 and contains only the adapter integration and its regression test. The policy conservatively gathers both MXFP8 layouts for recomputing models. Models without recomputation retain the existing per-phase behavior. Finer per-unit selection can be optimized separately.

Validation:

  • Added one parametrized regression covering selective output-discard and full reentrant checkpointing, comparing losses, complete local gradients, and updated weights with no recomputation over three SGD steps.
  • Black, isort, Pylint, Ruff, and git diff --check passed. The formatter's advisory mypy step reports missing Torch/TE imports in the workstation environment.
  • Four-GPU validation: all nine focused tests passed on every rank (36 total), with zero failures/skips and a clean exit. This includes the new selective/full regression and Add SchedulePolicy.unshard_all_planes_in_backward for MXFP8 recomputation in MFSDP v2 #8432's parity, plane-readiness, and default phase-gather tests.
  • Flash integration with Fix mHC unit boundaries for hook-driven MFSDP v2 #8784 and a separate graph-cleanup change passed both reduced-depth (16 updates) and full-shape (110 updates) runs, with finite printed losses/gradient norms, zero NaN/skips, all-rank capture-completion reports, and clean shutdown. These mock-data runs do not establish convergence or PP/VPP compatibility.

XiaodaNV and others added 7 commits October 31, 2026 02:53
Backward unshards MXFP8 weights with columnwise planes only and relies on a
recomputed FsdpModule's pre_forward to gather rowwise planes. A checkpoint can
recompute a module whose parameters another FsdpModule owns without re-entering
that owner's pre_forward, e.g. MTP eh_proj under the root, or TransformerLayer
MLP linears under selective MLP recompute, so TE fails with missing row-scaled
FP8 data. Register a forward pre-hook on each module directly holding an
FsdpModule's parameters that unshards the owner for forward compute during
recomputation. Groups serving both phases are already ready; sharded MXFP8
groups gather their rowwise planes.

Signed-off-by: Xiaoda Zhang <xiaodaz@nvidia.com>
Signed-off-by: Xiaoda Zhang <xiaodaz@nvidia.com>
Signed-off-by: Xiaoda Zhang <xiaodaz@nvidia.com>
Signed-off-by: Xiaoda Zhang <xiaodaz@nvidia.com>
…e-enter the module

Signed-off-by: Xiaoda Zhang <xiaodaz@nvidia.com>
…cks in tests

Signed-off-by: Xiaoda Zhang <xiaodaz@nvidia.com>
Signed-off-by: Jack Chang <jianbinc@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@copy-pr-bot
copy-pr-bot Bot force-pushed the pull-request/8432 branch from 7133fc6 to efe6b4a Compare November 1, 2026 01:28
@copy-pr-bot
copy-pr-bot Bot deleted the branch NVIDIA:pull-request/8432 November 1, 2026 06:20
@copy-pr-bot copy-pr-bot Bot closed this Nov 1, 2026
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