Repository navigation
Reject amsgrad in DeepSpeedCPUAdam instead of ignoring it - #8694
Merged
delock merged 1 commit intoSep 29, 2026
Merged
Conversation
The CPU Adam kernel has no AMSGrad path, so amsgrad=True was stored in the param group and then dropped: the optimizer ran plain Adam. FusedAdam and FusedLamb already raise for this, so the same config failed on GPU but silently changed the algorithm once optimizer offload was enabled. Check amsgrad in add_param_group, which covers the constructor and groups added later, and skip the C++ destroy in __del__ when construction failed. Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
vineethsaivs
requested review from
loadams,
tjruwase and
tohtana
as code owners
September 28, 2026 16:44
delock
approved these changes
Sep 29, 2026
Merged
via the queue into
deepspeedai:master
with commit Sep 29, 2026
53e336c
14 of 18 checks passed
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.
DeepSpeedCPUAdam(amsgrad=True)silently runs plain Adam. The CPU kernel has no AMSGrad path, so the flag is stored in the param group and never read. With"amsgrad": truein the optimizer config,FusedAdamraises, but turning onoffload_optimizerswaps in CPU Adam and the run trains with a different algorithm and no warning.Fix: reject
amsgradinadd_param_group, the same wayFusedAdamandFusedLambdo. That covers the constructor, the engine's config path, ZenFlow's subclass and groups added later.__del__now skips the C++ destroy when construction failed, so the error isn't followed by anAttributeError.Test:
test_cpu_adam_rejects_amsgradfails on master (DID NOT RAISE) and passes with the fix.tests/unit/ops/adam/and the Muon partial-training tests pass: 158 passed, 14 skipped.