MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / test_perf

Function test_perf

tests/test-sampling.cpp:290–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288#define BENCH(__cnstr, __data, __n_iter) bench((__cnstr), #__cnstr, (__data), (__n_iter))
289
290static void test_perf() {
291 const int n_vocab = 1 << 17;
292
293 std::vector<llama_token_data> data;
294
295 data.reserve(n_vocab);
296 for (int i = 0; i < n_vocab; i++) {
297 const float logit = 2.0f*((double)(rand())/RAND_MAX - 0.5);
298 data.emplace_back(llama_token_data{i, logit, 0.0f});
299 }
300
301 BENCH(llama_sampler_init_top_k (40), data, 32);
302 BENCH(llama_sampler_init_top_p (0.8f, 1), data, 32);
303 BENCH(llama_sampler_init_min_p (0.2f, 1), data, 32);
304 BENCH(llama_sampler_init_typical(0.5f, 1), data, 32);
305 BENCH(llama_sampler_init_xtc (1.0f, 0.1f, 1, 1), data, 32);
306}
307
308int main(void) {
309 ggml_time_init();

Callers 1

mainFunction · 0.85

Calls 5

llama_sampler_init_top_kFunction · 0.85
llama_sampler_init_top_pFunction · 0.85
llama_sampler_init_min_pFunction · 0.85
llama_sampler_init_xtcFunction · 0.85

Tested by

no test coverage detected