Merge pull request #3964 from ollama/mxyng/weights

fix gemma, command-r layer weights
This commit is contained in:
Michael Yang 2024-04-26 15:23:33 -07:00 committed by GitHub
commit 65fadddc85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,10 +102,14 @@ func EstimateGPULayers(gpus []gpu.GpuInfo, ggml *GGML, projectors []string, opts
layers := ggml.Tensors().Layers() layers := ggml.Tensors().Layers()
var memoryLayerOutput uint64 var memoryLayerOutput uint64
for k, v := range layers { if layer, ok := layers["output_norm"]; ok {
if k == "output" || k == "output_norm" { memoryLayerOutput += layer.size()
memoryLayerOutput += v.size() }
}
if layer, ok := layers["output"]; ok {
memoryLayerOutput += layer.size()
} else if layer, ok := layers["token_embd"]; ok {
memoryLayerOutput += layer.size()
} }
if gpus[0].Library == "metal" && opts.UseMMap { if gpus[0].Library == "metal" && opts.UseMMap {