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
435cc866
"...text-generation-inference.git" did not exist on "dea9c0dc741875fde9225e6c2a51d7bb8fb052e4"
Commit
435cc866
authored
Apr 22, 2024
by
Michael Yang
Browse files
fix: mixtral graph
parent
62be2050
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
llm/ggml.go
llm/ggml.go
+9
-1
No files found.
llm/ggml.go
View file @
435cc866
...
@@ -343,7 +343,15 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
...
@@ -343,7 +343,15 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
4
*
batch
*
(
embedding
+
vocab
)
+
embedding
*
vocab
*
105
/
128
,
4
*
batch
*
(
embedding
+
vocab
)
+
embedding
*
vocab
*
105
/
128
,
)
)
if
ffnGateWeight
,
ok
:=
layers
[
"0"
][
"ffn_gate.0.weight"
];
ok
{
if
ffnGateExpsWeight
,
ok
:=
layers
[
"blk.0"
][
"ffn_gate_exps.weight"
];
ok
{
// mixtral 8x22b
ff
:=
uint64
(
llm
.
KV
()[
"llama.feed_forward_length"
]
.
(
uint32
))
partialOffload
=
max
(
3
*
ffnGateExpsWeight
.
size
()
+
4
*
batch
*
(
2
*
ff
+
headsKV
+
embedding
+
context
+
embedding
/
heads
*
headsKV
),
4
*
(
context
*
batch
*
heads
+
context
*
embedding
/
heads
*
headsKV
+
batch
*
1024
+
embedding
/
heads
*
headsKV
*
batch
),
)
}
else
if
ffnGateWeight
,
ok
:=
layers
[
"blk.0"
][
"ffn_gate.0.weight"
];
ok
{
// mixtral 8x7b
ffnGateWeight1
:=
ffnGateWeight
.
Shape
[
1
]
ffnGateWeight1
:=
ffnGateWeight
.
Shape
[
1
]
fullOffload
=
4
*
batch
*
(
2
+
3
*
embedding
+
context
*
(
1
+
heads
)
+
2
*
headsKV
+
ffnGateWeight1
)
fullOffload
=
4
*
batch
*
(
2
+
3
*
embedding
+
context
*
(
1
+
heads
)
+
2
*
headsKV
+
ffnGateWeight1
)
partialOffload
=
max
(
partialOffload
=
max
(
...
...
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