[GH-ISSUE #3841] Slow inference speed #48891

Closed
opened 2026-04-28 09:58:43 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @userandpass on GitHub (Apr 23, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3841

What is the issue?

A100 80G
Run qwen1.57B using lmdeploy framework with two processes per card and use two cards to launch qwen1.57B via ollama, which is about 2 times slower than lmdeploy

OS

Linux

GPU

Nvidia

CPU

No response

Ollama version

0.1.32

Originally created by @userandpass on GitHub (Apr 23, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3841 ### What is the issue? A100 80G Run qwen1.57B using lmdeploy framework with two processes per card and use two cards to launch qwen1.57B via ollama, which is about 2 times slower than lmdeploy ### OS Linux ### GPU Nvidia ### CPU _No response_ ### Ollama version 0.1.32
GiteaMirror added the bug label 2026-04-28 09:58:43 -05:00
Author
Owner

@pdevine commented on GitHub (May 18, 2024):

I tried w/ a 2xa100 40GB w/ 4bit quantized qwen 1.8B (qwen:1.8b-chat) and got:

total duration:       1.416382244s
load duration:        2.553585ms
prompt eval count:    13 token(s)
prompt eval duration: 58.553ms
prompt eval rate:     222.02 tokens/s
eval count:           168 token(s)
eval duration:        1.219709s
eval rate:            137.74 tokens/s

With the non-quantized fp16 version (qwen:1.8b-chat-fp16) I got:

total duration:       2.629780047s
load duration:        1.202665ms
prompt eval count:    18 token(s)
prompt eval duration: 16.545ms
prompt eval rate:     1087.94 tokens/s
eval count:           297 token(s)
eval duration:        2.467525s
eval rate:            120.36 tokens/s

with ollama ps:

$ ollama ps
NAME               	ID          	SIZE  	PROCESSOR	UNTIL
qwen:1.8b-chat-fp16	7b9c77c7b5b6	3.7 GB	100% GPU 	4 minutes from now

and nvidia-smi:

$ nvidia-smi
Sat May 18 18:23:13 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.15              Driver Version: 550.54.15      CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA A100-SXM4-40GB          Off |   00000000:00:05.0 Off |                    0 |
| N/A   25C    P0             51W /  400W |    4304MiB /  40960MiB |      0%      Default |
|                                         |                        |             Disabled |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA A100-SXM4-40GB          Off |   00000000:00:06.0 Off |                    0 |
| N/A   24C    P0             42W /  400W |       3MiB /  40960MiB |      0%      Default |
|                                         |                        |             Disabled |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A     28154      C   ...unners/cuda_v11/ollama_llama_server       4298MiB |
+-----------------------------------------------------------------------------------------+

I believe everything is working as intended? You didn't mention the toks/sec that you were getting so I'm not sure if maybe qwen was running on the CPU and not the GPU? If you could upgrade to 0.1.38 it's possible that that might fix things (there were a lot of changes that have gone in since 0.1.32. I'll go ahead and close the issue, but feel free to keep commenting and we can reopen.

<!-- gh-comment-id:2118910897 --> @pdevine commented on GitHub (May 18, 2024): I tried w/ a 2xa100 40GB w/ 4bit quantized qwen 1.8B (`qwen:1.8b-chat`) and got: ``` total duration: 1.416382244s load duration: 2.553585ms prompt eval count: 13 token(s) prompt eval duration: 58.553ms prompt eval rate: 222.02 tokens/s eval count: 168 token(s) eval duration: 1.219709s eval rate: 137.74 tokens/s ``` With the non-quantized fp16 version (`qwen:1.8b-chat-fp16`) I got: ``` total duration: 2.629780047s load duration: 1.202665ms prompt eval count: 18 token(s) prompt eval duration: 16.545ms prompt eval rate: 1087.94 tokens/s eval count: 297 token(s) eval duration: 2.467525s eval rate: 120.36 tokens/s ``` with `ollama ps`: ``` $ ollama ps NAME ID SIZE PROCESSOR UNTIL qwen:1.8b-chat-fp16 7b9c77c7b5b6 3.7 GB 100% GPU 4 minutes from now ``` and nvidia-smi: ``` $ nvidia-smi Sat May 18 18:23:13 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 550.54.15 Driver Version: 550.54.15 CUDA Version: 12.4 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-SXM4-40GB Off | 00000000:00:05.0 Off | 0 | | N/A 25C P0 51W / 400W | 4304MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 1 NVIDIA A100-SXM4-40GB Off | 00000000:00:06.0 Off | 0 | | N/A 24C P0 42W / 400W | 3MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | 0 N/A N/A 28154 C ...unners/cuda_v11/ollama_llama_server 4298MiB | +-----------------------------------------------------------------------------------------+ ``` I believe everything is working as intended? You didn't mention the toks/sec that you were getting so I'm not sure if maybe qwen was running on the CPU and not the GPU? If you could upgrade to `0.1.38` it's possible that that might fix things (there were a lot of changes that have gone in since `0.1.32`. I'll go ahead and close the issue, but feel free to keep commenting and we can reopen.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#48891