|
liblloyal 1.0.0
Composable primitives for llama.cpp inference
|
Classes | |
| struct | BranchMetricsState |
| struct | PerplexityState |
Functions | |
| float | max_finite (const float *a, int n) |
| Find maximum finite value in array Used for log-sum-exp shift to prevent overflow. | |
| float | log_sum_exp (const float *a, int n, float shift) |
| Numerically stable log-sum-exp Computes log(Σ exp(aᵢ)) using shift trick to avoid overflow. | |
| std::unordered_map< PerplexityHandle, PerplexityState > & | get_registry () |
| PerplexityHandle & | get_next_handle () |
| std::unordered_map< BranchMetricsHandle, BranchMetricsState > & | get_branch_metrics_registry () |
| BranchMetricsHandle & | get_next_branch_metrics_handle () |
Variables | |
| constexpr float | LN2 = 0.693147180559945309417232121458176568f |
|
inline |
Definition at line 437 of file metrics.hpp.
|
inline |
Definition at line 442 of file metrics.hpp.
|
inline |
Definition at line 97 of file metrics.hpp.
|
inline |
Definition at line 92 of file metrics.hpp.
|
inline |
Numerically stable log-sum-exp Computes log(Σ exp(aᵢ)) using shift trick to avoid overflow.
| a | Array of log-space values |
| n | Array length |
| shift | Max value for numerical stability |
Definition at line 76 of file metrics.hpp.
|
inline |
Find maximum finite value in array Used for log-sum-exp shift to prevent overflow.
Definition at line 58 of file metrics.hpp.
|
constexpr |
Definition at line 52 of file metrics.hpp.