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
fb9580df
Unverified
Commit
fb9580df
authored
Apr 16, 2024
by
Michael Yang
Committed by
GitHub
Apr 16, 2024
Browse files
Merge pull request #3684 from ollama/mxyng/scale-graph
scale graph based on gpu count
parents
7c9792a6
26df6747
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
gpu/gpu_darwin.go
gpu/gpu_darwin.go
+1
-1
llm/server.go
llm/server.go
+3
-0
No files found.
gpu/gpu_darwin.go
View file @
fb9580df
...
@@ -55,6 +55,6 @@ func getCPUMem() (memInfo, error) {
...
@@ -55,6 +55,6 @@ func getCPUMem() (memInfo, error) {
return
memInfo
{
return
memInfo
{
TotalMemory
:
uint64
(
C
.
getPhysicalMemory
()),
TotalMemory
:
uint64
(
C
.
getPhysicalMemory
()),
FreeMemory
:
0
,
FreeMemory
:
0
,
DeviceCount
:
0
,
DeviceCount
:
1
,
},
nil
},
nil
}
}
llm/server.go
View file @
fb9580df
...
@@ -79,6 +79,9 @@ func NewLlamaServer(model string, adapters, projectors []string, opts api.Option
...
@@ -79,6 +79,9 @@ func NewLlamaServer(model string, adapters, projectors []string, opts api.Option
graphFullOffload
=
graphPartialOffload
graphFullOffload
=
graphPartialOffload
}
}
graphFullOffload
*=
uint64
(
info
.
DeviceCount
)
graphPartialOffload
*=
uint64
(
info
.
DeviceCount
)
// memoryRequiredTotal represents the memory required for full GPU offloading (all layers)
// memoryRequiredTotal represents the memory required for full GPU offloading (all layers)
memoryRequiredTotal
:=
memoryMinimum
+
graphFullOffload
memoryRequiredTotal
:=
memoryMinimum
+
graphFullOffload
...
...
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