LLM inference in C/C++
C++ ggml
test: (test-llama-archs) log the config name first (#23885)
Xuan-Son Nguyene674b1279bc9
diff --git a/tests/test-llama-archs.cpp b/tests/test-llama-archs.cppindex 3714eaedb0..1def7faff6 100644--- a/tests/test-llama-archs.cpp+++ b/tests/test-llama-archs.cpp@@ -526,8 +526,9 @@ static int test_backends(const llm_arch target_arch, const size_t seed, const ggmax_arch_name_length = std::max(max_arch_name_length, strlen(llm_arch_name(arch)));}- const std::string template_header = std::string("|%" + std::to_string(max_arch_name_length) + "s|%") + std::to_string(max_device_label_length) + "s|%6s|%15s|%9s|\n";- const std::string template_row = std::string("|%" + std::to_string(max_arch_name_length) + "s|%") + std::to_string(max_device_label_length) + "s|%6s|%15s %10s|%20s|\n";+ const std::string template_header = std::string("|%" + std::to_string(max_arch_name_length) + "s|%") + std::to_string(max_device_label_length) + "s|%6s|%15s|%9s|\n";+ const std::string template_row_cfg = std::string("|%" + std::to_string(max_arch_name_length) + "s|%") + std::to_string(max_device_label_length) + "s|%6s|";+ const std::string template_row_res = "%15s %10s|%20s|\n";bool all_ok = true;common_log_flush(common_log_main());@@ -565,6 +566,11 @@ static int test_backends(const llm_arch target_arch, const size_t seed, const ggstd::pair<llama_model_ptr, llama_context_ptr> model_and_ctx_cpu;std::vector<float> logits_cpu;for (device_config & dc : dev_configs) {+ // print test config first; should anything fail during model loading or inference, at least we know which test case caused it+ printf(template_row_cfg.c_str(),+ llm_arch_name(arch), dc.label.c_str(), config_name.c_str());+ fflush(stdout);+std::pair<llama_model_ptr, llama_context_ptr> model_and_ctx_dev;std::vector<float> logits_dev;std::string status_nmse = "\033[1;33mSKIP\033[0m";@@ -617,8 +623,9 @@ static int test_backends(const llm_arch target_arch, const size_t seed, const gg}}- printf(template_row.c_str(), llm_arch_name(arch), dc.label.c_str(),- config_name.c_str(), status_nmse.c_str(), nmse_str, status_roundtrip.c_str());+ // log the results for this test case+ printf(template_row_res.c_str(),+ status_nmse.c_str(), nmse_str, status_roundtrip.c_str());}}}