microsoft / microsoft/onnxruntime

Using Multi-GPUs for inferencing

Open
#6,216 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

contributions welcome ep:CUDA
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

How to add multiple GPU for inferencing a model ?

I tried to use all my 4 GPUs by
```
session_option = InferenceSession(
model_path, options, providers=["CUDAExecutionProvider"],
)
for i in range(4):
option = {'device_id': i}
session_option.set_providers(providers=["CUDAExecutionProvider"], provider_options=[option])
```
Is it the right way to use multiple GPUs?

**It perform worst than using single GPU.**

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

No file or test is named. Start with the Python InferenceSession and set_providers calls shown in the issue, then review how CUDAExecutionProvider device_id options are applied across sessions. Done means establishing whether this configuration supports multi-GPU inference and explaining why it performs worse than a single GPU.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.