deepspeedai / deepspeedai/DeepSpeed

Opinion on Refactoring Ulysses

Open
#6,843 0 comments 0 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

Is your feature request related to a problem? Please describe.
Hi, I am suggesting my ideas on refactoring Ulysses.

  1. post_all2all_func and .permute() seems unnecessary if we opt out for regular all_to_all function instead of all_to_all_single. After all_to_all, we can torch.cat along the gather_idx dimension to concatenate agnostically.
  2. Double nested if loops due to batch_dim_idx makes code very hard to read. I'm thinking that splitting input tensor agnostic to batch_dim_idx and using all_to_all can also alleviate this?

Questions from Commit 17ed7c7

  1. So interestingly, fusing QKV actually degrades performance if concat and slices are necessary?
  2. Do you think you can elaborate on pipelining QKV comm and GEMM? Is this referring to doing GEMM with data that stays during all2all?

Appreciate your feedback!

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

Review commit 17ed7c7 and the implementations of post_all2all_func, permute(), all_to_all, and all_to_all_single. The issue asks for opinions about a possible refactor and QKV communication rather than defining a patch or completion criteria, so seek maintainer direction before coding.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Refactor
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.