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

Function llama_perf_sampler

smallthinker/src/llama-sampling.cpp:2545–2558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2543// perf
2544
2545struct llama_perf_sampler_data llama_perf_sampler(const struct llama_sampler * chain) {
2546 struct llama_perf_sampler_data data = {};
2547
2548 if (chain == nullptr || chain->iface != &llama_sampler_chain_i) {
2549 GGML_ABORT("%s: invalid sampler passed - requires a sampler created with llama_sampler_chain_init()\n", __func__);
2550 }
2551
2552 const auto * ctx = (const struct llama_sampler_chain *) chain->ctx;
2553
2554 data.t_sample_ms = 1e-3 * ctx->t_sample_us;
2555 data.n_sample = std::max(0, ctx->n_sample);
2556
2557 return data;
2558}
2559
2560void llama_perf_sampler_print(const struct llama_sampler * chain) {
2561 const auto data = llama_perf_sampler(chain);

Callers 2

llama_perf_sampler_printFunction · 0.85
llama.hFile · 0.85

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected