Archived
radiance 1.7.0
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves every shipped container - Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime - /v1/messages works with Claude Code as it ships (gearwave00001) - a long agent conversation keeps its cached history when the client rewrites its last turn (manueloverride) - a stream's first event goes out with the first token, so llama-benchy measures prefill right - opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42) - four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b) - NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA adapters (baKon) - many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool arguments and the CPU's vision and audio encoders - plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
This commit is contained in:
1 parent
b068190326
commit
1e968f6e1d
739 files changed
+128447
-84632
No files matched your search
+17
-22
@@ -1,15 +1,13 @@
|
||||
/* gbnf_oracle.h -- upstream's candidate walk, kept as the oracle the GBNF mask engine is tested
|
||||
* against.
|
||||
/* gbnf_oracle.h -- upstream's candidate walk, the oracle the GBNF mask engine is tested against.
|
||||
*
|
||||
* fill_mask serves a mask from a plan precomputed at compile time (core/sample/gbnf_mask.cpp).
|
||||
* This computes the same mask the way llama.cpp's llama_grammar_apply_impl does: every piece in
|
||||
* the vocabulary decoded against the carried partial character and rescanned per stack, per code
|
||||
* point. The two are implementations of one pure function of the grammar's state, so the test is
|
||||
* equality, bit for bit and status for status, and any difference is a defect in the engine.
|
||||
* This computes the same mask as llama.cpp's llama_grammar_apply_impl: every vocabulary piece is
|
||||
* decoded against the carried partial character and rescanned per stack, per code point. Both
|
||||
* compute one pure function of the grammar state, so tests require bit-for-bit and status-for-
|
||||
* status equality.
|
||||
*
|
||||
* It is linked into the tests and the acceptance tool only. It costs a full rescan of the
|
||||
* vocabulary per stack per mask, which is what the engine exists to avoid, and it must never be
|
||||
* reachable from a serving path.
|
||||
* Linked into the tests and the acceptance tool only. It rescans the whole vocabulary per stack
|
||||
* per mask and must never be reachable from a serving path.
|
||||
*/
|
||||
#pragma once
|
||||
#include "sample/gbnf.h"
|
||||
@@ -18,22 +16,19 @@
|
||||
|
||||
namespace rad {
|
||||
|
||||
/* The mask for `g`'s current state. Returns what fill_mask must return for it: RAD_OK, RAD_E_STATE
|
||||
* when the grammar has no live parse or admits no token, RAD_E_SHAPE when `n_words` is short --
|
||||
* or RAD_E_FULL when the rescan outgrows `work_limit` (the engine's per-operation bound when 0),
|
||||
* which is a comparison the caller could not make rather than a disagreement. A lazy grammar
|
||||
* still waiting for its trigger admits everything. */
|
||||
/* The mask for `g`'s current state, with fill_mask's status: RAD_OK, RAD_E_STATE when the grammar
|
||||
* has no live parse or admits no token, RAD_E_SHAPE when `n_words` is short, or RAD_E_FULL when the
|
||||
* rescan exceeds `work_limit` (0: the engine's per-operation bound). RAD_E_FULL means no comparison
|
||||
* was possible, not a disagreement. A lazy grammar awaiting its trigger admits everything. */
|
||||
int gbnf_oracle_mask(const GbnfGrammar& g, uint32_t* bitmask, int64_t n_words,
|
||||
uint64_t work_limit = 0);
|
||||
|
||||
/* THE STATE ACCEPTING `token` LEAVES, the way the stack machinery builds it: every stack advanced
|
||||
* one code point at a time through accept_chr and the epsilon closure, as upstream's
|
||||
* llama_grammar_accept_impl does. The engine steps the stacks that match code points through the
|
||||
* mask plan's automaton instead, and the two must leave the same stack set and the same carried
|
||||
* partial character. `*out` comes back sorted. Returns RAD_OK, RAD_E_STATE when no stack
|
||||
* survives, or RAD_E_FULL / RAD_E_NOMEM past the engine's bounds. For a grammar not waiting on
|
||||
* its trigger, and a token that is not end-of-generation -- accept_token answers those without
|
||||
* the stacks. */
|
||||
/* The state accepting `token` leaves, built as upstream's llama_grammar_accept_impl does: every
|
||||
* stack advanced one code point at a time through accept_chr and the epsilon closure. The engine
|
||||
* steps code-point stacks through the mask plan's automaton instead; both must leave the same stack
|
||||
* set and carried partial character. `*out` is sorted. Returns RAD_OK, RAD_E_STATE when no stack
|
||||
* survives, or RAD_E_FULL / RAD_E_NOMEM past the engine's bounds. Only for a grammar not awaiting
|
||||
* its trigger and a non-end-of-generation token; accept_token answers those without the stacks. */
|
||||
int gbnf_oracle_accept(const GbnfGrammar& g, int32_t token, GbnfStacks* out,
|
||||
PartialUtf8* partial);
|
||||
|
||||
|
||||
Reference in new issue
Block a user