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
2003d601
Commit
2003d601
authored
Aug 08, 2024
by
Michael Yang
Browse files
llama3.1 memory
parent
7d1c0047
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 @
2003d601
...
@@ -344,11 +344,13 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
...
@@ -344,11 +344,13 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
switch
llm
.
KV
()
.
Architecture
()
{
switch
llm
.
KV
()
.
Architecture
()
{
case
"llama"
:
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
=
4
*
batch
*
embedding
partialOffload
+=
max
(
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
*
(
1
+
embedding
+
max
(
context
,
embedding
))
+
embedding
*
embedding
*
9
/
16
+
4
*
context
*
(
batch
*
heads
+
embeddingHeads
*
headsKV
),
4
*
batch
*
(
embedding
+
vocab
)
+
embedding
*
vocab
*
105
/
128
,
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