Repository navigation
Conversation
Signed-off-by: ZenAlexa <zimingwang945@gmail.com>
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryAdds opt-in
No new actionable issues were found. GPU tests were not run during this review. Reviews (3) · Last reviewed commit: "chore: merge current main for cpu optimi..." · Reviewed by Greptile |
Signed-off-by: ZenAlexa <zimingwang945@gmail.com>
Signed-off-by: ZenAlexa <zimingwang945@gmail.com>
This branch has not been deployed
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.
description
add opt-in
state_dict_cpu_offload=FalsetoFusedAdam, allowing checkpoint callers that use the no-argumentstate_dict()API to move each converted state to CPU before exporting the next one. this addresses the GPU expansion peak reported in Automodel #4209, where checkpoint CPU offload runs after the complete optimizer dictionary has already been materialized.Fixes #3668.
type of change
changes
keep the existing state conversion and DTensor wrapping, then copy each export state to CPU when the option is enabled. placing the copy after wrapping avoids CUDA meshes moving a CPU local tensor back to the GPU. exported values, dtypes, keys and distributed metadata remain unchanged, while live optimizer state and parameter-group metadata retain their existing ownership and placement.
add a standalone lifecycle scenario to the existing L0 runner, covering repeated exports, restoration and continued updates, including sharded DCP with the
flatten_optimizer_state_dict=Trueconfiguration used by Automodel. the option is a constructor setting so the existing optimizer factory can forward it without changing DCP's call signature.verification
merged main
63451d6b868athrough a normal merge atd080a53d1b75on November 1. the FusedAdam owner retains main'ste_device_typeimport migration, and the CPU export implementation and both QA entry points are unchanged. current-head scoped pre-commit, repository license checks, Python syntax, QA shell syntax and contribution-diff checks pass. the merged revision has not been rebuilt or rerun on a GPU.earlier native validation
the native build recorded for the
7a3c25482cd0contribution revision succeeded on H200 with PyTorch2.12.0.dev20260408+cu128, CUDA 12.8.61, GCC 13.3, cuDNN 9.20.0.48 and the source-pinned CUTLASS revision. the compiled common library, PyTorch extension and Python package are installed together as TE2.22.0.dev0, without a source overlay or platform-getter replacement. the earlier TE 2.20.2 compatibility run remains historical evidence.the distributed QA job now invokes the scenario with two ranks, closing the review finding about skipped DTensor/DCP checks. its failure status goes through the job's existing
test_failpath.flatten=False/True × sync/asynccombinations. full-state DCP also passes default/CPU export with synchronous and asynchronous saves, followed by load and continued updates.27selected FusedAdam regressions with12 deselected, using-k "TestFusedAdam and not MXFP8 and not Float8Block". the earlier main/candidate Python comparison passed the same selection for both arms.the GPU allocation increments measured in that earlier native run were:
these measurements use two BF16 moments and report temporary PyTorch allocated memory above the pre-export level. comparing with a baseline that subsequently copies the complete dictionary to CPU gives the same peak differences and the same final CPU payload, with zero additional GPU export allocation retained at the common endpoint. total process memory and checkpoint storage are separate quantities.
a full-state gather can move exported states back to the mesh device, as documented. the complete L0 matrix, minimum supported PyTorch version, larger cross-world-size configurations and original 64-GB200 recipe remain unrun. the FP8 scenarios emit the release's
Float8Tensor_to_copywarning and still pass their value and continued-update checks. please run the project's full build and distributed optimizer matrix before merging.