deepspeedai / deepspeedai/DeepSpeed

[REQUEST] Any plan to refactor those huge classes?

Open
#1,650 2 comments 1 reaction 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 don't know whether DeepSpeed is planning to do large refactor, if not, below is my suggestion.

Is your feature request related to a problem? Please describe.
Thanks for this great project, DeepSpeed is wonderful incredible powerful.
But i found its python codes full of large even huge classes, as DeepSpeed turned more powerful, classes become larger and hard to read or maintain.

Describe the solution you'd like
I think Instead of adding more new features, it is better to do more refactor, or in the near future, DeepSpeed will be hard to maintain, hard to debug or add even little new feature.
DeepSpeed is mainly manipulating data/weight, if refactor it by DOP(data oriented programming), the code should be much better to read and maintain.
There is a good book of data oriented programming: https://livebook.manning.com/book/data-oriented-programming/chapter-1/v-13/

Describe alternatives you've considered
DOP can live with OOP, so refactor can go on many steps.
Or just refactor the large classes to smaller modular classes should be also great.
I found fairscale(https://github.com/facebookresearch/fairscale) has similar functions with DeepSpeed, but its codes are much simpler.

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

The issue does not name files, classes, tests, or an entry point. Start by surveying the large Python classes in DeepSpeed and comparing the relevant areas with FairScale, then establish a specific refactoring scope and acceptance criteria. Done would require an agreed, modular refactor rather than a general proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.