Skip to content

Commit

Permalink
fix: estimate
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <[email protected]>
  • Loading branch information
thxCode committed Aug 21, 2024
1 parent 20bea94 commit 9cee44a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cmd/gguf-parser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,9 @@ func tprint(title string, headers, bodies [][]any) {
for i := range r {
r[i].Number = i + 1
r[i].AutoMerge = true
if len(headers) > 1 && (headers[1][i] == "UMA" || headers[1][i] == "NonUMA") {
r[i].AutoMerge = false
}
r[i].Align = text.AlignCenter
r[i].AlignHeader = text.AlignCenter
}
Expand Down
6 changes: 3 additions & 3 deletions file_estimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (gf *GGUFFile) EstimateLLaMACppUsage(opts ...LLaMACppUsageEstimateOption) (
}

// Full offload: isOffloadOutputLayer && nLoadLayers == 0.
// Partial offload: nLoadLayers > 0 && nOffloadLayers > 0.
// Partial offload: !isOffloadOutputLayer.
// Zero offload: nOffloadLayers == 0.
var (
nLoadLayers = a.BlockCount
Expand Down Expand Up @@ -254,8 +254,8 @@ func (gf *GGUFFile) EstimateLLaMACppUsage(opts ...LLaMACppUsageEstimateOption) (
e.OffloadLayers = nOffloadLayers

fullOffload = isOffloadOutputLayer && nLoadLayers == 0
partialOffload = nLoadLayers > 0 && nOffloadLayers > 0
zeroOffload = !fullOffload && !partialOffload
partialOffload = !isOffloadOutputLayer
zeroOffload = nOffloadLayers == 0
}

// Footprint.
Expand Down

0 comments on commit 9cee44a

Please sign in to comment.