enable q8, q5, 5_1, and f32 for linux gpu (#699)
This commit is contained in:
parent
d104b7e997
commit
d06bc0cb6e
1 changed files with 17 additions and 14 deletions
31
llm/llm.go
31
llm/llm.go
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/pbnjay/memory"
|
"github.com/pbnjay/memory"
|
||||||
|
|
||||||
|
@ -37,20 +38,22 @@ func New(workDir, model string, adapters []string, opts api.Options) (LLM, error
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ggml.FileType() {
|
if runtime.GOOS == "darwin" {
|
||||||
case "Q8_0":
|
switch ggml.FileType() {
|
||||||
if ggml.Name() != "gguf" && opts.NumGPU != 0 {
|
case "Q8_0":
|
||||||
// GGML Q8_0 do not support Metal API and will
|
if ggml.Name() != "gguf" && opts.NumGPU != 0 {
|
||||||
// cause the runner to segmentation fault so disable GPU
|
// GGML Q8_0 do not support Metal API and will
|
||||||
log.Printf("WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0")
|
// cause the runner to segmentation fault so disable GPU
|
||||||
opts.NumGPU = 0
|
log.Printf("WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0")
|
||||||
}
|
opts.NumGPU = 0
|
||||||
case "F32", "Q5_0", "Q5_1":
|
}
|
||||||
if opts.NumGPU != 0 {
|
case "F32", "Q5_0", "Q5_1":
|
||||||
// F32, Q5_0, Q5_1, and Q8_0 do not support Metal API and will
|
if opts.NumGPU != 0 {
|
||||||
// cause the runner to segmentation fault so disable GPU
|
// F32, Q5_0, Q5_1, and Q8_0 do not support Metal API and will
|
||||||
log.Printf("WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0")
|
// cause the runner to segmentation fault so disable GPU
|
||||||
opts.NumGPU = 0
|
log.Printf("WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0")
|
||||||
|
opts.NumGPU = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue