Skip to content

Commit

Permalink
refactor: embedding usage estimate
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <[email protected]>
  • Loading branch information
thxCode committed Dec 12, 2024
1 parent 8385070 commit e63e4a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion file_estimate__llamacpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,16 +359,22 @@ func (gf *GGUFFile) EstimateLLaMACppRun(opts ...GGUFRunEstimateOption) (e LLaMAC

ls := gf.Layers()
ioLs, tfLs, _ := ls.Cut([]string{
"position_embd.weight",
"token_embd.weight",
"token_embd_norm.weight",
"token_embd_norm.bias",
"token_types.weight",
"cls.bias",
"cls.weight",
"cls.output.bias",
"cls.output.weight",
"output.weight",
"output.bias",
"output_norm.weight",
"output_norm.bias",
})
ipLs, opLs, _ := ioLs.Cut([]string{
"position_embd.weight",
"token_embd.weight",
"token_embd_norm.weight",
"token_embd_norm.bias",
Expand Down Expand Up @@ -603,7 +609,7 @@ func (gf *GGUFFile) EstimateLLaMACppRun(opts ...GGUFRunEstimateOption) (e LLaMAC
}
}
// Finally, get the usage of output layer.
if a.Type == "model" {
if a.Type == "model" && a.AttentionCausal {
var outInc uint64
if a.Architecture == "mamba" {
outInc += inpSMask + inpSSeq
Expand Down

0 comments on commit e63e4a6

Please sign in to comment.