MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / test

Method test

subprojects/llama.cpp/tools/llama-bench/llama-bench.cpp:1335–1376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1333 std::vector<uint64_t> samples_ns;
1334
1335 test(const cmd_params_instance & inst, const llama_model * lmodel, const llama_context * ctx) :
1336 cpu_info(get_cpu_info()),
1337 gpu_info(get_gpu_info()) {
1338
1339 model_filename = inst.model;
1340 char buf[128];
1341 llama_model_desc(lmodel, buf, sizeof(buf));
1342 model_type = buf;
1343 model_size = llama_model_size(lmodel);
1344 model_n_params = llama_model_n_params(lmodel);
1345 n_batch = inst.n_batch;
1346 n_ubatch = inst.n_ubatch;
1347 n_threads = inst.n_threads;
1348 cpu_mask = inst.cpu_mask;
1349 cpu_strict = inst.cpu_strict;
1350 poll = inst.poll;
1351 type_k = inst.type_k;
1352 type_v = inst.type_v;
1353 n_gpu_layers = inst.n_gpu_layers;
1354 n_cpu_moe = inst.n_cpu_moe;
1355 split_mode = inst.split_mode;
1356 main_gpu = inst.main_gpu;
1357 no_kv_offload = inst.no_kv_offload;
1358 flash_attn = inst.flash_attn;
1359 devices = inst.devices;
1360 tensor_split = inst.tensor_split;
1361 tensor_buft_overrides = inst.tensor_buft_overrides;
1362 use_mmap = inst.use_mmap;
1363 use_direct_io = inst.use_direct_io;
1364 embeddings = inst.embeddings;
1365 no_op_offload = inst.no_op_offload;
1366 no_host = inst.no_host;
1367 n_prompt = inst.n_prompt;
1368 n_gen = inst.n_gen;
1369 n_depth = inst.n_depth;
1370 // RFC 3339 date-time format
1371 time_t t = time(NULL);
1372 std::strftime(buf, sizeof(buf), "%FT%TZ", gmtime(&t));
1373 test_time = buf;
1374
1375 (void) ctx;
1376 }
1377
1378 uint64_t avg_ns() const { return ::avg(samples_ns); }
1379

Callers

nothing calls this directly

Calls 5

get_cpu_infoFunction · 0.85
get_gpu_infoFunction · 0.85
llama_model_descFunction · 0.85
llama_model_sizeFunction · 0.85
llama_model_n_paramsFunction · 0.85

Tested by

no test coverage detected