[WIP] Prototype original-parameter AdamW8bit state for FSDP1 - #2081
Open
gss10282025 wants to merge 1 commit into
Open
gss10282025 wants to merge 1 commit into
gss10282025 wants to merge 1 commit into
Conversation
Signed-off-by: gss10282025 <326855337+gss10282025@users.noreply.github.com>
gss10282025
marked this pull request as ready for review
September 10, 2026 17:03
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.
Summary
Add an executable reference for keeping AdamW8bit state attached to original parameters under FSDP1. It gathers each original parameter's gradients, updates per-parameter shadow state, and copies the resulting values back into the flat shards.
Related to #2080.
This is a draft for discussing the state-layout contract. The reference replicates optimizer state and uses private FSDP1 metadata. A production version still needs a supported metadata interface and sharded state; checkpointing, AMP, and offload are outside this example.
Validation
Run with:
Passed on PyTorch 2.13.0+cpu and bitsandbytes 0.50.2, with two CPU/Gloo ranks and two optimizer updates:
6.15e-5.Ruff lint/format checks and Python compilation pass. The example also accepts
--device cuda; that command was not rerun for this PR.