[PR #11863] perf: build graph for next batch async to keep GPU busy #13638

Closed
opened 2026-04-13 00:31:44 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/11863

State: closed
Merged: Yes


This refactors the main run loop of the ollama runner to perform the main GPU intensive tasks (Compute+Floats) in a go routine so we can prepare the next batch in parallel to reduce the amount of time the GPU stalls waiting for the
next batch of work.

On metal, I see a 2-3% speedup in token rate. On a single RTX 4090 I see a ~7% speedup.

**Original Pull Request:** https://github.com/ollama/ollama/pull/11863 **State:** closed **Merged:** Yes --- This refactors the main run loop of the ollama runner to perform the main GPU intensive tasks (Compute+Floats) in a go routine so we can prepare the next batch in parallel to reduce the amount of time the GPU stalls waiting for the next batch of work. On metal, I see a 2-3% speedup in token rate. On a single RTX 4090 I see a ~7% speedup.
GiteaMirror added the pull-request label 2026-04-13 00:31:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#13638