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
a039e383
Unverified
Commit
a039e383
authored
Apr 02, 2024
by
Michael Yang
Committed by
GitHub
Apr 02, 2024
Browse files
Merge pull request #3465 from ollama/mxyng/fix-metal
fix metal gpu
parents
a57818d9
80163ebc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
llm/server.go
llm/server.go
+2
-2
No files found.
llm/server.go
View file @
a039e383
...
@@ -85,7 +85,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
...
@@ -85,7 +85,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
graph
:=
int64
(
ggml
.
KV
()
.
GQA
())
*
kv
/
6
graph
:=
int64
(
ggml
.
KV
()
.
GQA
())
*
kv
/
6
usedMemory
+=
graph
usedMemory
+=
graph
if
usedMemory
>
availableMemory
||
slices
.
Contains
(
cpuOnlyFamilies
,
ggml
.
KV
()
.
Architecture
())
{
if
(
usedMemory
>
availableMemory
||
slices
.
Contains
(
cpuOnlyFamilies
,
ggml
.
KV
()
.
Architecture
())
)
&&
info
.
Library
!=
"metal"
{
info
.
Library
=
"cpu"
info
.
Library
=
"cpu"
}
}
...
@@ -159,7 +159,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
...
@@ -159,7 +159,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
params
=
append
(
params
,
"--log-disable"
)
params
=
append
(
params
,
"--log-disable"
)
}
}
if
opts
.
NumGPU
>
0
{
if
opts
.
NumGPU
>
=
0
{
params
=
append
(
params
,
"--n-gpu-layers"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumGPU
))
params
=
append
(
params
,
"--n-gpu-layers"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumGPU
))
}
}
...
...
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