[PR #10700] Estimate projector memory correctly for Ollama engine #13332

Closed
opened 2026-04-13 00:24:07 -05:00 by GiteaMirror · 0 comments
Owner

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

State: closed
Merged: Yes


The Llama engine always places vision projectors on the first GPU if one exists. However, the Ollama engine groups it with the output layer, which means the projector is only offloaded if all other layers are offloaded. The memory estimation code always assumes the former layout - this changes it to use the correct layout based on the engine.

This addresses two impacts of the current behavior:

  • In multi-GPU setups, we can crash with OOM errors when we try to allocate memory on a full GPU while another still has space.
  • If the vision projector is large, it may prevent us from offloading anything when we could have fit some of the text layers.
**Original Pull Request:** https://github.com/ollama/ollama/pull/10700 **State:** closed **Merged:** Yes --- The Llama engine always places vision projectors on the first GPU if one exists. However, the Ollama engine groups it with the output layer, which means the projector is only offloaded if all other layers are offloaded. The memory estimation code always assumes the former layout - this changes it to use the correct layout based on the engine. This addresses two impacts of the current behavior: - In multi-GPU setups, we can crash with OOM errors when we try to allocate memory on a full GPU while another still has space. - If the vision projector is large, it may prevent us from offloading anything when we could have fit some of the text layers.
GiteaMirror added the pull-request label 2026-04-13 00:24:07 -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#13332