microsoft / microsoft/onnxruntime
Using Multi-GPUs for inferencing
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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