Skip to content

Commit

Permalink
docs: estimate
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <[email protected]>
  • Loading branch information
thxCode committed Jun 14, 2024
1 parent f40a734 commit 85cfcd0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions file_estimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ func (gf *GGUFFile) EstimateLLaMACppUsage(opts ...LLaMACppUsageEstimateOption) (
rs := l.Bytes()
attnInc += rs
}
// https://github.com/ggerganov/llama.cpp/blob/172c8256840ffd882ab9992ecedbb587d9b21f15/llama.cpp#L6986-L6992.
rs := o.CacheKeyType.RowSizeOf([]uint64{uint64(a.AttentionKeyLength), nKV, a.AttentionHeadCountKV})
attnInc += rs
// https://github.com/ggerganov/llama.cpp/blob/172c8256840ffd882ab9992ecedbb587d9b21f15/llama.cpp#L7000-L7007.
rs = o.CacheValueType.RowSizeOf([]uint64{uint64(a.AttentionValueLength), nKV, a.AttentionHeadCountKV})
attnInc += rs
} else {
Expand Down

0 comments on commit 85cfcd0

Please sign in to comment.