deepspeedai / deepspeedai/DeepSpeed

[RFC] Support sharding LM heads and adopting Online Softmax

Open
#8,173 5 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

Motivation

Online softmax and in-place computation could significantly save memory, especially for OPSD teacher TP sharding.

  • Extend AutoTP capabilities by integrating Liger Kernel (sharding LM heads and adopting Online Softmax) #8104

Keypoints

  • Support the sharding LM heads with gather_output=False of ColumnParallelLinear
  • Enabling parallel CE loss feature (integrating Liger kernel)
  • Profiling the GPU footprint to evaluate
  • Unify the untied and tied path for LM heads

Revised Roadmap

PR Scope Status
#8146 Enable gather_output=True for column-parallel lm_head Merged
#8185 Uneven sharding + universal checkpoint; remove uneven-dim rowwise fallback Merged
PR-A (#8302) Lift hardcoded name == "lm_head" routing; training defaults to column parallelism; reject unsupported row-parallel training Merged
PR-B (#8309) gather_output=False + vocab-parallel cross entropy, pure PyTorch reference implementation Ready to merge
PR-C VocabParallelEmbedding; unify tied and untied lm_head paths; fix #8290 To do
PR-D (#8540) Optional Liger fused CE acceleration + memory profiling WIP
PR-E (#8538) Implement row-parallel lm_head training, including input slicing and backward dx all-reduce WIP

Proposed PR Sequencing

#8146 ──► #8185 ──┬─► PR-A  Lift hardcoded routing; independently mergeable
                  │
                  └─► PR-B  gather_output=False + vocab-parallel CE
                        ├─► PR-C  VocabParallelEmbedding / tied-untied unification
                        └─► PR-D  Liger integration + profiling

PR-A ──► PR-E  Row-parallel lm_head training

PR-A is small and low-risk, and has no code-level dependency on gather_output;
it can be submitted against master in parallel. PR-B is the core of this RFC —
we suggest landing the pure PyTorch implementation first so that numerical
correctness can be reviewed independently, and deferring the Liger kernel
integration to PR-D.

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

This is an RFC rather than a self-contained task; start by reading the revised roadmap and referenced PRs #8146, #8185, #8302, #8309, #8540, and #8538. No files, tests, or specific entry points are named, so a discrete remaining scope and validation criteria are needed before implementation can be considered done.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
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.