deepspeedai / deepspeedai/DeepSpeed

[REQUEST] Non-element-wise Optimizer Compatibility

Open
#6,701 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

I am encountering issues when using non-element-wise optimizers such as Adam-mini with DeepSpeed.
According to the documentation, it reads:

The FP16 Optimizer is designed to maximize the achievable memory bandwidth by merging all the parameters of the model into a single large buffer, and applying the weight updates in a single kernel, allowing it to achieve high memory bandwidth.

As for Adam-Mini, the merging of parameters into a single buffer degenerates it to SGD with only one global second moment. This will corrupt the training, causing spikes and NaNs.

Recently have seen a trend developing non-element-wise optimizers. Besides Adam-Mini, there are several different ones using matrix SVD, like Fira (https://arxiv.org/abs/2410.01623) and Muon (https://github.com/KellerJordan/modded-nanogpt/blob/master/train_gpt2.py). Blindly merging parameters will corrupt these optimizers as well. This limitation is impacting my ability to fully leverage DeepSpeed for my training needs.

Of course, this issue can be avoided by using naive DDP in Lightning. But the speed also slows down unbearably by 40%. Is there a recommended approach or workaround for integrating non-element-wise optimizers with DeepSpeed? Or are there plans to support such optimizers in future releases?

Thank you for your assistance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FP16 Optimizer documentation and the parameter-merging behavior described in the issue. Compare that behavior with Adam-Mini, Fira, and Muon, then investigate how DeepSpeed integrates optimizers during distributed training. Done means establishing a supported approach for non-element-wise optimizers without corrupted updates, spikes, or NaNs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.