MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / get_values

Method get_values

examples/llama-bench/llama-bench.cpp:603–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601 }
602
603 std::vector<std::string> get_values() const {
604 std::string tensor_split_str;
605 int max_nonzero = 0;
606 for (int i = 0; i < LLAMA_MAX_DEVICES; i++) {
607 if (tensor_split[i] > 0) {
608 max_nonzero = i;
609 }
610 }
611 for (int i = 0; i <= max_nonzero; i++) {
612 char buf[32];
613 snprintf(buf, sizeof(buf), "%.2f", tensor_split[i]);
614 tensor_split_str += buf;
615 if (i < max_nonzero) {
616 tensor_split_str += "/";
617 }
618 }
619 std::vector<std::string> values = {
620 build_commit, std::to_string(build_number),
621 std::to_string(cuda), std::to_string(opencl), std::to_string(metal), std::to_string(gpu_blas), std::to_string(blas),
622 cpu_info, gpu_info,
623 model_filename, model_type, std::to_string(model_size), std::to_string(model_n_params),
624 std::to_string(n_batch), std::to_string(n_threads), std::to_string(!f32_kv),
625 std::to_string(n_gpu_layers), std::to_string(main_gpu), std::to_string(mul_mat_q), tensor_split_str,
626 std::to_string(n_prompt), std::to_string(n_gen), test_time,
627 std::to_string(avg_ns()), std::to_string(stdev_ns()),
628 std::to_string(avg_ts()), std::to_string(stdev_ts())
629 };
630 return values;
631 }
632
633 std::map<std::string, std::string> get_map() const {
634 std::map<std::string, std::string> map;

Callers 3

print_testMethod · 0.45
print_testMethod · 0.45
print_testMethod · 0.45

Calls 1

to_stringFunction · 0.50

Tested by

no test coverage detected