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
bf612cd6
Unverified
Commit
bf612cd6
authored
Sep 05, 2024
by
Michael Yang
Committed by
GitHub
Sep 05, 2024
Browse files
Merge pull request #6260 from ollama/mxyng/mem
llama3.1 memory
parents
ef98e561
2003d601
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
llm/ggml.go
llm/ggml.go
+4
-2
No files found.
llm/ggml.go
View file @
bf612cd6
...
...
@@ -360,11 +360,13 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
switch
llm
.
KV
()
.
Architecture
()
{
case
"llama"
:
fullOffload
=
4
*
batch
*
(
1
+
4
*
embedding
+
context
*
(
1
+
heads
))
fullOffload
=
max
(
4
*
batch
*
(
1
+
4
*
embedding
+
context
*
(
1
+
heads
)),
4
*
batch
*
(
embedding
+
vocab
),
)
partialOffload
=
4
*
batch
*
embedding
partialOffload
+=
max
(
// 4*batch*(4+6*embedding+context*(2*heads)+llm.KV().GQA()),
4
*
batch
*
(
1
+
embedding
+
max
(
context
,
embedding
))
+
embedding
*
embedding
*
9
/
16
+
4
*
context
*
(
batch
*
heads
+
embeddingHeads
*
headsKV
),
4
*
batch
*
(
embedding
+
vocab
)
+
embedding
*
vocab
*
105
/
128
,
)
...
...
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