deepspeedai / deepspeedai/DeepSpeed

[REQUEST] Saving or Exporting `InferenceEngine`s to support model scaling in production

Open
#1,694 5 comments 4 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.
I want to use DeepSpeed Inference in production and I am wondering whether there are suggested solutions for reducing the scaling latency introduced by init_inference(). It takes a considerable amount of time to initialize an inference engine and this will make it difficult to dynamically scale model instances.

Frankly, I assume there already is a solution, but I have not found a description in the documentation.

Describe the solution you'd like
I want to reduce or eliminate the latency introduced by the deepspeed.init_inference() call that is used in the DS Inference tutorials. For example, is it possible to export/save an initialized inference engine?

Describe alternatives you've considered
I have not considered any alternatives, but I would be open to suggestions.

Additional context
I am new to DeepSpeed and I do not know how the time requirements of inference engine initialization vary across model types and sizes. I was motivated to open this issue after testing the GPT-J inference kernels --- I didn't time init_inference(), but it certainly took long enough to pose an obstacle for efficient scaling.

EDIT: initialization takes about 57 seconds on my system (AWS SageMaker ml.g4dn.12xlarge instance).

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 DS Inference tutorials and the deepspeed.init_inference() entry point, then measure or trace the reported initialization latency for the GPT-J inference kernels. Determine whether an initialized inference engine can be saved or exported for reuse during scaling; done means a supported approach is implemented or the recommended limitation and alternative are documented.

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.