mirror of
https://github.com/ollama/ollama.git
synced 2026-08-04 14:56:15 +00:00
llama-server: allow GPU offload for projectors (#16473)
Special case Metal iGPUs to enable GPU offload.
This commit is contained in:
parent
e5a38739b4
commit
01557ff313
2 changed files with 10 additions and 2 deletions
|
|
@ -631,7 +631,7 @@ func shouldDisableMMProjOffload(opts api.Options, gpus []ml.DeviceInfo, modelLay
|
|||
}
|
||||
|
||||
for _, gpu := range gpus {
|
||||
if gpu.Integrated {
|
||||
if gpu.Integrated && gpu.Library != "Metal" {
|
||||
return true, "shared-memory-gpu"
|
||||
}
|
||||
memory := gpu.FreeMemory
|
||||
|
|
|
|||
|
|
@ -1839,13 +1839,21 @@ func TestAppendMMProjArgs(t *testing.T) {
|
|||
want: []string{"base", "--mmproj", "model.gguf", "--no-mmproj-offload"},
|
||||
},
|
||||
{
|
||||
name: "integrated gpu disables projector offload",
|
||||
name: "integrated rocm gpu disables projector offload",
|
||||
projectors: []string{"model.gguf"},
|
||||
opts: defaultOpts,
|
||||
gpus: []ml.DeviceInfo{{DeviceID: ml.DeviceID{Library: "ROCm"}, Integrated: true, FreeMemory: 32 << 30}},
|
||||
modelLayers: 81,
|
||||
want: []string{"base", "--mmproj", "model.gguf", "--no-mmproj-offload"},
|
||||
},
|
||||
{
|
||||
name: "integrated metal gpu keeps projector offload",
|
||||
projectors: []string{"model.gguf"},
|
||||
opts: defaultOpts,
|
||||
gpus: []ml.DeviceInfo{{DeviceID: ml.DeviceID{Library: "Metal"}, Integrated: true, FreeMemory: 32 << 30}},
|
||||
modelLayers: 81,
|
||||
want: []string{"base", "--mmproj", "model.gguf"},
|
||||
},
|
||||
{
|
||||
name: "cpu only request disables projector offload",
|
||||
projectors: []string{"model.gguf"},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue