deepspeedai / deepspeedai/DeepSpeed

[BUG] init_inference loads qwen3-32b model very slow but train model loads it quickly

Open
#7,369 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug inference
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

I try to use deepspeed.init_inference to load qwen3-32b model for inference in 4 L20(80GB memory each). It costs about 1 hour to finish the init_inference.
But when I use the huggingface transformer's trainer api with deepspeed enable, it only costs about 10min to load the model to the gpu and start training.

I add some log to figure out which method cost too much time and found it's the below code
https://github.com/deepspeedai/DeepSpeed/blob/f394e7803611f31157c5f449ba0c7f01859e936a/deepspeed/inference/engine.py#L172

that makes me very confused.

I also found the gpu memory usage increase very slow when use init_inference.
It increase only aboud 800M every 5s.

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 at deepspeed/inference/engine.py around line 172, where the report observes the slow initialization, and compare that loading path with the Hugging Face Trainer path using DeepSpeed. Reproduce the timing and GPU-memory progression for Qwen3-32B on four L20 GPUs; done means the cause is identified and a verified resolution or limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.