This commit is contained in:
takuya kodama 2026-04-13 06:21:48 +02:00 committed by GitHub
commit 4e8d870f43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 7 deletions

View File

@ -3504,7 +3504,7 @@ void llama_memory_breakdown_print(const struct llama_context * ctx) {
const std::string template_gpu = "%s: | %s | %s = %s + (%s = %s + %s + %s) + %s |\n";
const std::string template_other = "%s: | %s | %s %s %s = %s + %s + %s %s |\n";
table_data.push_back({template_header, "memory breakdown [MiB]", "total", "free", "self", "model", "context", "compute", "unaccounted"});
table_data.push_back({{template_header, "memory breakdown [MiB]", "total", "free", "self", "model", "context", "compute", "unaccounted"}});
constexpr size_t MiB = 1024 * 1024;
const std::vector<std::string> desc_prefixes_strip = {"NVIDIA ", "GeForce ", "Tesla ", "AMD ", "Radeon ", "Instinct "};
@ -3564,7 +3564,7 @@ void llama_memory_breakdown_print(const struct llama_context * ctx) {
const size_t self = mb.model + mb.context + mb.compute;
const size_t unaccounted = total - self - free;
table_data.push_back({
table_data.push_back({{
template_gpu,
" - " + name + " (" + desc + ")",
std::to_string(total / MiB),
@ -3573,13 +3573,13 @@ void llama_memory_breakdown_print(const struct llama_context * ctx) {
std::to_string(mb.model / MiB),
std::to_string(mb.context / MiB),
std::to_string(mb.compute / MiB),
std::to_string(unaccounted / MiB)});
std::to_string(unaccounted / MiB)}});
}
// print memory breakdown for host:
{
const size_t self = mb_host.model + mb_host.context + mb_host.compute;
table_data.push_back({
table_data.push_back({{
template_other,
" - Host",
"", // total
@ -3588,7 +3588,7 @@ void llama_memory_breakdown_print(const struct llama_context * ctx) {
std::to_string(mb_host.model / MiB),
std::to_string(mb_host.context / MiB),
std::to_string(mb_host.compute / MiB),
""}); // unaccounted
""}}); // unaccounted
}
// print memory breakdown for all remaining buffer types:
@ -3600,7 +3600,7 @@ void llama_memory_breakdown_print(const struct llama_context * ctx) {
}
const std::string name = ggml_backend_buft_name(buft);
const size_t self = mb.model + mb.context + mb.compute;
table_data.push_back({
table_data.push_back({{
template_other,
" - " + name,
"", // total
@ -3609,7 +3609,7 @@ void llama_memory_breakdown_print(const struct llama_context * ctx) {
std::to_string(mb.model / MiB),
std::to_string(mb.context / MiB),
std::to_string(mb.compute / MiB),
""}); // unaccounted
""}}); // unaccounted
seen_buffer_types.insert(buft);
}