Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
0b7ade0d
Unverified
Commit
0b7ade0d
authored
Nov 20, 2023
by
Michael Yang
Committed by
GitHub
Nov 20, 2023
Browse files
Merge pull request #1212 from jmorganca/mxyng/metal
enable metal for fp32, q5_0, q5_1
parents
31ab453d
19b7a4d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
llm/llm.go
llm/llm.go
+1
-8
No files found.
llm/llm.go
View file @
0b7ade0d
...
@@ -41,20 +41,13 @@ func New(workDir, model string, adapters []string, opts api.Options) (LLM, error
...
@@ -41,20 +41,13 @@ func New(workDir, model string, adapters []string, opts api.Options) (LLM, error
if
runtime
.
GOOS
==
"darwin"
{
if
runtime
.
GOOS
==
"darwin"
{
switch
ggml
.
FileType
()
{
switch
ggml
.
FileType
()
{
case
"Q8_0"
:
case
"F32"
,
"Q5_0"
,
"Q5_1"
,
"Q8_0"
:
if
ggml
.
Name
()
!=
"gguf"
&&
opts
.
NumGPU
!=
0
{
if
ggml
.
Name
()
!=
"gguf"
&&
opts
.
NumGPU
!=
0
{
// GGML Q8_0 do not support Metal API and will
// GGML Q8_0 do not support Metal API and will
// cause the runner to segmentation fault so disable GPU
// cause the runner to segmentation fault so disable GPU
log
.
Printf
(
"WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0"
)
log
.
Printf
(
"WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0"
)
opts
.
NumGPU
=
0
opts
.
NumGPU
=
0
}
}
case
"F32"
,
"Q5_0"
,
"Q5_1"
:
if
opts
.
NumGPU
!=
0
{
// F32, Q5_0, Q5_1, and Q8_0 do not support Metal API and will
// cause the runner to segmentation fault so disable GPU
log
.
Printf
(
"WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0"
)
opts
.
NumGPU
=
0
}
}
}
var
requiredMemory
int64
var
requiredMemory
int64
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment