Repository navigation
Test the weight sync from an AutoTP trainer into a TP4 copy - #1
Open
Achyuthan-S wants to merge 1 commit into
Open
Achyuthan-S wants to merge 1 commit into
Achyuthan-S wants to merge 1 commit into
Conversation
An AutoTP TP2 x DP2 trainer under ZeRO-1, ZeRO-2 and ZeRO-3, and under ZeRO-3 with the model built in zero.Init, syncs into one TP4 copy over the same four ranks, with autotp_storage_affine_maps as the source maps. Each shard is checked against the engine's own 16-bit consolidation, before and after a training step. The module docstring and the docs no longer call the AutoTP source untested. Signed-off-by: Achyuthan Sivasankar <achyuthan.sivasankar@gmail.com>
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.
The AutoTP TP2 → TP4 test I promised on deepspeedai#9045, for your branch at 48a3575.
What it adds (
test_an_autotp_trainer_syncs_into_a_tp4_copyinTestAffineWeightSync):zero.Init. In the last case the norm, which AutoTP leaves alone, keeps a partition over the whole world.autotp_storage_affine_maps(engine.module)as the source maps, into one TP4 copy over the same ranks (_layouts(4), so theupanddownshards are uneven: 5, 5, 4, 4).layout.extractof the full weights fromengine._consolidated_16bit_state_dict(), before and after a training step. That consolidation gathers over ZeRO and TP on the engine's own path and shares no code with the maps.TestAutoTPStorageMapsdoes. DeepSpeed broadcasts the initial weights only within each data-parallel group, so without the seed the two TP ranks hold differentdown.biasand the replicas disagree. AutoTP's dataloader check also needs the same batch on both TP ranks.affine-transfer.rstno longer call the AutoTP source untested.Validation on macOS arm64 CPU, Python 3.9.6, torch 2.8.0, gloo (
DS_ACCELERATOR=cpu LOCAL_SIZE=4, fromtests/):test_shards_given_at_each_sync_follow_offload_and_reload, which fails the same way on unmodified 48a3575 here: thefused_adamop needs ninja to build, and this machine doesn't have it.autotp_storage_affine_mapsmakes all four cases fail onup.weight.