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
f0ad49ea
Commit
f0ad49ea
authored
Apr 23, 2025
by
Michael Yang
Committed by
Michael Yang
Apr 25, 2025
Browse files
memory
parent
7ba9fa9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
fs/ggml/ggml.go
fs/ggml/ggml.go
+5
-2
No files found.
fs/ggml/ggml.go
View file @
f0ad49ea
...
...
@@ -430,7 +430,7 @@ func (f GGML) GraphSize(context, batch uint64, numParallel int, kvCacheType stri
}
switch
f
.
KV
()
.
Architecture
()
{
case
"llama"
:
case
"llama"
,
"llama4"
:
fullOffload
=
max
(
4
*
batch
*
(
1
+
4
*
embedding
+
context
*
(
1
+
heads
)),
4
*
batch
*
(
embedding
+
vocab
),
...
...
@@ -444,7 +444,7 @@ func (f GGML) GraphSize(context, batch uint64, numParallel int, kvCacheType stri
if
ffnGateExpsWeight
,
ok
:=
layers
[
"blk.0"
][
"ffn_gate_exps.weight"
];
ok
{
// mixtral 8x22b
ff
:=
uint64
(
f
.
KV
()
[
"llama.
feed_forward_length"
]
.
(
uint32
))
ff
:=
uint64
(
f
.
KV
()
.
Uint
(
"
feed_forward_length"
))
partialOffload
=
max
(
3
*
ffnGateExpsWeight
.
Size
()
+
4
*
batch
*
(
2
*
ff
+
headsKV
+
embedding
+
context
+
embeddingHeads
*
headsKV
),
4
*
(
context
*
batch
*
heads
+
context
*
embeddingHeads
*
headsKV
+
batch
*
1024
+
embeddingHeads
*
headsKV
*
batch
),
...
...
@@ -640,6 +640,9 @@ func (llm GGML) VisionGraphSize() (weights, graphSize uint64) {
graphSize
=
4
*
(
imageSize
*
imageSize
*
numChannels
+
embeddingLength
*
patchSize
+
numPatches
*
numPatches
*
headCount
)
case
"llama4"
:
// vision graph is computed independently in the same schedule
// and is negligible compared to the worst case text graph
}
return
weights
,
graphSize
...
...
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