Lightning-AI / Lightning-AI/pytorch-lightning

Any plans in adding support for DeepSpeedHybridEngine

Open
#17,682 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature strategy: deepspeed
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Description & Motivation

I'm using lightning for my project using PPO algorithm.
During an optimisation step, both inference and training are needed, so it's slow with LLMs.
Recently, DeepSpeed introduced a HybridEngine for this scenario, with the benefits quoted below:
> The Hybrid-Engine is capable of seamlessly transitioning between inference and training modes within RLHF, allowing it to leverage various optimizations from DeepSpeed-Inference such as tensor-parallelism and high-performance transformer kernels for generation...

### Pitch

I wonder if you have any plan to add support for this new hybrid engine?

### Alternatives

A pointer to tutorials on how to add custom engines/strategies are also much appreciated.
I can create a PR afterwards if my project allows.

### Additional context

Link to [DeepSpeedHybridEngine](https://github.com/microsoft/DeepSpeed/blob/d1c3c0df5318cbcb2b221d38d4127dd566f4984d/deepspeed/runtime/hybrid_engine.py#L32)

cc @borda @awaelchli

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 by reading DeepSpeed's runtime/hybrid_engine.py, linked in the issue, and review the project's guidance for adding custom engines or strategies. Define the integration scope and acceptance criteria for switching between inference and training during PPO optimization; the issue does not name Lightning files or tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.