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
1ed4f521
Unverified
Commit
1ed4f521
authored
Jun 27, 2024
by
Michael Yang
Committed by
GitHub
Jun 27, 2024
Browse files
Merge pull request #5340 from ollama/mxyng/mem
gemma2 graph
parents
2cc7d050
de2163da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
llm/ggml.go
llm/ggml.go
+12
-3
No files found.
llm/ggml.go
View file @
1ed4f521
...
@@ -366,9 +366,18 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
...
@@ -366,9 +366,18 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
4
*
batch
*
(
1
+
2
*
embedding
+
context
*
(
1
+
heads
))
+
embedding
*
(
6
*
context
*
headsKV
/
heads
+
embedding
*
9
/
16
),
4
*
batch
*
(
1
+
2
*
embedding
+
context
*
(
1
+
heads
))
+
embedding
*
(
6
*
context
*
headsKV
/
heads
+
embedding
*
9
/
16
),
)
)
}
}
case
"gemma"
:
case
"gemma"
,
"gemma2"
:
fullOffload
=
4
*
batch
*
(
embedding
+
vocab
)
fullOffload
=
max
(
partialOffload
=
4
*
batch
*
(
2
*
embedding
+
vocab
+
1
)
+
embedding
*
vocab
*
105
/
128
4
*
batch
*
(
embedding
+
vocab
),
4
*
batch
*
(
2
+
context
+
context
*
heads
+
2
*
embedding
+
2
*
embeddingHeadsK
*
heads
),
)
partialOffload
=
max
(
4
*
embedding
*
batch
+
embedding
*
vocab
*
105
/
128
+
4
*
vocab
*
batch
,
4
*
batch
*
(
2
*
embedding
+
1
+
2
*
embeddingHeadsK
*
heads
+
context
+
context
*
heads
)
+
4
*
embeddingHeadsK
*
context
*
8
+
embedding
*
embeddingHeadsK
*
heads
*
9
/
16
,
)
case
"command-r"
:
case
"command-r"
:
fullOffload
=
max
(
fullOffload
=
max
(
4
*
batch
*
(
embedding
+
vocab
),
4
*
batch
*
(
embedding
+
vocab
),
...
...
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