Archived
radiance 2.1.0
New models. Recursive Flint (39.8B, about 2.5B active) by everplays (#422): `arch/flint`, as an IQ8R container with rotated int8 experts or a four-bit one, with a sink-aware WMMA prefill attention and the fused attention prologue at `rotary_dim` 0. Meta Muse Glimmer 30B by launch80_assets (#423): bf16, an int4 trunk or IQ8R, its windowed vision tower, its DFlash drafter, the ATEM tool dialect and context extension. Ling-3.0-tiny by RikshaDriver (#441): served from its GGUF releases or as IQ8R on `bailing_hybrid`, with six more libr3d kernels. Block FP8, MXFP4 and NVFP4 conversions of the three are not served. IQ8R containers of all three (round to nearest, no calibration) are on Hugging Face under StillDeadcode: flint-iq8r, muse-glimmer-30b-iq8r-dflash and ling-3.0-tiny-iq8r. They were checked for sane answers on two R9700; nothing was benchmarked, and Muse Glimmer's pictures, video and tool calls were not tried. Speech. Breeze-TTS-2 clones a voice from a reference recording and its transcript, with an optional delivery direction, by farcryjohn (#436). The published Breeze container needs converting again with the updated recipe before it can. Tools. A model entry with `diagnose: DIR` runs a fixed workload on the engine instead of serving and writes a report: step times, tokens a step, draft acceptance, TTFT and prefill rates by category, concurrency and prompt length, and with `diagnose-baseline` a token-for-token comparison against an earlier report (docs/DIAGNOSE.md), by Code000 (#418). Scheduler. `mixed-step-target-ms` holds a mixed prefill and decode step to a service time, off by default, by tnhnyzc (#413). `scheduler.stuck-exit` (60s by default, 0 never) ends the process when the device has advanced nothing for that long, so a restart policy brings a hung server back (#409, #415, #428). Fixed. Draft trees with the int8 KV cache, which stopped Gemma 4 31B with DFlash2 on its first request (#454, diagnosed by aelfwyne). The expert loan held at zero by a few leftover cache blocks after long sessions (#455, diagnosed by thekk1). The mapped tier's pages kept in the page cache across a load and a restore, by C_Tamas (#421). Replayed tool calls with blank arguments, and arguments that are not JSON refused naming the call, by dschmitz (#444). The dashboard's card temperature reads the junction sensor, by dschmitz (#453). The VRAM shortfall report says what the KL mode needs, by baKon (#448). The out-of-tree plugin test builds its plugins in parallel and takes its toolchain from the tree. Plugin ABI 40: out-of-tree plugins need to be rebuilt. Thanks to @everplays, @launch80_assets, @RikshaDriver, @farcryjohn, @Code000, @tnhnyzc, @C_Tamas, @dschmitz, @baKon, @aelfwyne and @thekk1.
This commit is contained in:
1 parent
ddcb9c69bb
commit
2a2b756371
166 files changed
+20749
-327
No files matched your search
+149
-9
@@ -1063,7 +1063,8 @@ int ReplyParser::create(std::shared_ptr<const ReplyFormat> fmt, const ReplyOptio
|
||||
/* A response format replaces the call grammar outright; the calls are not parsed. */
|
||||
P.calls = want_calls && !opt.response_format;
|
||||
P.breaks = want_calls && F.f.has_reasoning() && !F.f.reasoning_breaks.empty();
|
||||
P.pure = !F.f.has_reasoning() && !want_calls && !opt.response_format;
|
||||
P.pure = !F.f.has_reasoning() && !want_calls && !opt.response_format &&
|
||||
F.f.content_open.empty();
|
||||
P.anywhere = F.f.reasoning_anywhere && F.f.has_reasoning() && opt.extract_reasoning &&
|
||||
!opt.response_format;
|
||||
|
||||
@@ -1093,6 +1094,7 @@ enum class St : uint8_t {
|
||||
LeadWs, /* whitespace before the reply proper: dropped */
|
||||
ThinkOpen, /* the core of reasoning_open */
|
||||
ThinkOpenWs, /* the optional whitespace that ends reasoning_open */
|
||||
ContentOpen, /* content_open, the header of a reply that does not reason */
|
||||
Think, /* reasoning text */
|
||||
ThinkCloseWs, /* the optional whitespace that ends reasoning_close */
|
||||
Text, /* content, watching for the call opener when calls are on */
|
||||
@@ -1149,6 +1151,7 @@ struct ReplyStream::Impl {
|
||||
explicit Impl(const ReplyParser::Impl& p) : P(p), F(p.fmt->impl()) {
|
||||
content.init(P.terminators.empty() ? nullptr : &P.terms, &P.terminators);
|
||||
st = P.pure ? St::Text : St::LeadWs;
|
||||
think_hold_on = P.calls && !F.f.reasoning_breaks.empty();
|
||||
if (P.anywhere) {
|
||||
text_dfa = P.calls ? &F.text_think : &F.think_only;
|
||||
n_open = P.calls ? F.openers.size() : 0;
|
||||
@@ -1211,6 +1214,16 @@ struct ReplyStream::Impl {
|
||||
std::string vheld;
|
||||
size_t vs_pos = 0;
|
||||
bool fenced = false;
|
||||
/* Channel-scoped protocols (Muse): with tools on, a trailing `to=NAME<|message|>` while
|
||||
* reasoning streams is the handoff to a tool call, not reasoning text. The reasoning's
|
||||
* tail is held until it cannot grow into framing or a header; a completed tool-channel
|
||||
* header is dropped along with everything after it -- the section opener is where the
|
||||
* call machinery takes over. Without the hold the header lands in the reasoning stream,
|
||||
* and a model that hesitates at the handoff repeats it (observed on Muse Glimmer: three
|
||||
* or four `to=read<|message|>` headers before the section, under speculative decoding). */
|
||||
bool think_hold_on = false;
|
||||
std::string think_hold;
|
||||
bool think_handoff = false;
|
||||
|
||||
/* The argument object being read: its open brackets; whether a key (not a value) is being
|
||||
* read; a separator read but not yet written (written only once the next member shows the
|
||||
@@ -1293,12 +1306,108 @@ struct ReplyStream::Impl {
|
||||
|
||||
void think_out(const char* p, size_t n) {
|
||||
if (n == 0) return;
|
||||
if (think_handoff) return; /* past the tool-channel header: call framing, dropped */
|
||||
touch(0);
|
||||
if (think_text) { msg.reasoning.append(p, n); return; }
|
||||
for (size_t i = 0; i < n; ++i)
|
||||
if (!is_blank((unsigned char)p[i])) { think_text = true; break; }
|
||||
think_pend.append(p, n);
|
||||
if (think_text) { msg.reasoning += think_pend; think_pend.clear(); }
|
||||
if (!think_hold_on) {
|
||||
if (think_text) { msg.reasoning.append(p, n); return; }
|
||||
for (size_t i = 0; i < n; ++i)
|
||||
if (!is_blank((unsigned char)p[i])) { think_text = true; break; }
|
||||
think_pend.append(p, n);
|
||||
if (think_text) { msg.reasoning += think_pend; think_pend.clear(); }
|
||||
return;
|
||||
}
|
||||
touch(0);
|
||||
think_hold.append(p, n);
|
||||
flush_think_hold(false);
|
||||
}
|
||||
|
||||
void emit_reasoning_upto(size_t emit) {
|
||||
if (emit == 0) return;
|
||||
const std::string part = think_hold.substr(0, emit);
|
||||
if (think_text) { msg.reasoning += part; }
|
||||
else {
|
||||
for (size_t i = 0; i < part.size(); ++i)
|
||||
if (!is_blank((unsigned char)part[i])) { think_text = true; break; }
|
||||
think_pend += part;
|
||||
if (think_text) { msg.reasoning += think_pend; think_pend.clear(); }
|
||||
}
|
||||
}
|
||||
|
||||
/* The handoff position from the last `<|eom|>`: the tail reads as the tool-channel
|
||||
* header -- optional `<|start|>assistant`, ws, `to=`, recipient name bytes (never
|
||||
* `user`: that transition matches the reply close above and is consumed by it), then
|
||||
* `<|message|>` or a prefix of it while the header streams. npos: no handoff. */
|
||||
size_t tool_handoff_at() const {
|
||||
static const std::string eom = "<|eom|>", start = "<|start|>assistant", to = "to=";
|
||||
/* The framing is bounded (terminator + assistant + `to=` + a recipient + the message
|
||||
* marker); scanning only the tail keeps a byte-at-a-time stream linear. */
|
||||
const size_t wstart = think_hold.size() - std::min(kHoldWindow, think_hold.size());
|
||||
size_t p = std::string::npos;
|
||||
for (size_t q = think_hold.find(eom, wstart); q != std::string::npos;
|
||||
q = think_hold.find(eom, q + 1))
|
||||
p = q;
|
||||
if (p == std::string::npos) return std::string::npos;
|
||||
size_t k = p + eom.size();
|
||||
if (think_hold.compare(k, start.size(), start) == 0) k += start.size();
|
||||
while (k < think_hold.size() && is_ws((unsigned char)think_hold[k])) ++k;
|
||||
if (think_hold.compare(k, to.size(), to) != 0) return std::string::npos;
|
||||
return p; /* everything from `<|eom|>` on is the tool call's framing */
|
||||
}
|
||||
|
||||
/* Muse's channel protocol, per the reference parsers (vLLM's muse reasoning/tool
|
||||
* parsers; llama.cpp PR #26841): reasoning streams until `<|eom|>`, and the model
|
||||
* sometimes leaves the analysis channel WITHOUT it, opening a tool channel directly
|
||||
* (`<|start|>assistant to=read<|message|>`) -- a documented model-side defect. So the
|
||||
* reasoning's tail is held while it could still grow into that framing, and once the
|
||||
* handoff is detected everything from the header on is dropped: the call machinery
|
||||
* (the section + invoke tags) has already produced the tool_calls events. */
|
||||
void flush_think_hold(bool final_feed) {
|
||||
if (think_handoff) return; /* past the handoff: framing, dropped */
|
||||
size_t emit = think_hold.size();
|
||||
const size_t handoff = tool_handoff_at();
|
||||
if (handoff != std::string::npos) {
|
||||
emit = handoff;
|
||||
think_handoff = true;
|
||||
} else if (!final_feed) {
|
||||
/* Hold a tail that could still grow into the handoff framing: a partial
|
||||
* `<|eom|>` / `<|start|>` / `<|message|>` marker, or a trailing ` to=NAME`. */
|
||||
static const std::string markers[] = {"<|eom|>", "<|start|>", "<|message|>"};
|
||||
for (const std::string& mk : markers)
|
||||
for (size_t k = std::min(mk.size(), think_hold.size()); k > 0; --k)
|
||||
if (think_hold.compare(think_hold.size() - k, k, mk, 0, k) == 0)
|
||||
emit = std::min(emit, think_hold.size() - k);
|
||||
const size_t wstart_t = think_hold.size() - std::min(kHoldWindow, think_hold.size());
|
||||
size_t at = std::string::npos;
|
||||
for (size_t q = think_hold.find("to=", wstart_t); q != std::string::npos;
|
||||
q = think_hold.find("to=", q + 1))
|
||||
at = q;
|
||||
if (at != std::string::npos) {
|
||||
bool tail = true;
|
||||
for (size_t k = at + 3; k < think_hold.size(); ++k)
|
||||
if (!is_name_byte((unsigned char)think_hold[k])) { tail = false; break; }
|
||||
if (tail) {
|
||||
size_t a = at;
|
||||
while (a > 0 && is_ws((unsigned char)think_hold[a - 1])) --a;
|
||||
emit = std::min(emit, a);
|
||||
}
|
||||
}
|
||||
if (emit >= think_hold.size()) {
|
||||
emit_reasoning_upto(emit);
|
||||
think_hold.clear(); /* nothing held: everything goes out now */
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (emit > 0) emit_reasoning_upto(emit);
|
||||
think_hold.erase(0, emit);
|
||||
if (final_feed) think_hold.clear();
|
||||
}
|
||||
|
||||
/* The tail the framing scans read; a longer tail is real reasoning, never framing. */
|
||||
static constexpr size_t kHoldWindow = 160;
|
||||
|
||||
static bool is_name_byte(unsigned char c) {
|
||||
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ||
|
||||
c == '_' || c == '.' || c == '-';
|
||||
}
|
||||
|
||||
void text_out(const char* p, size_t n) {
|
||||
@@ -2051,6 +2160,20 @@ struct ReplyStream::Impl {
|
||||
return p + 1;
|
||||
}
|
||||
/* No block: what was held is read again as whatever follows one. */
|
||||
st = after_no_block();
|
||||
read_again(lhold);
|
||||
lhold.clear();
|
||||
return p;
|
||||
}
|
||||
|
||||
case St::ContentOpen: {
|
||||
const unsigned char c = (unsigned char)*p;
|
||||
if (lpos < F.f.content_open.size() && (unsigned char)F.f.content_open[lpos] == c) {
|
||||
lhold.push_back((char)c);
|
||||
if (++lpos == F.f.content_open.size()) { lhold.clear(); st = after_think(); }
|
||||
return p + 1;
|
||||
}
|
||||
/* Not the header: what was held is content (or the start of the document). */
|
||||
st = after_think();
|
||||
read_again(lhold);
|
||||
lhold.clear();
|
||||
@@ -2066,10 +2189,11 @@ struct ReplyStream::Impl {
|
||||
case St::Think: {
|
||||
const Dfa& d = P.breaks ? F.think_breaks : F.think;
|
||||
p = scan(d, p, e, &hit, [this](const char* q, size_t n) { think_out(q, n); });
|
||||
if (hit == 0) { trail = 0; st = St::ThinkCloseWs; }
|
||||
if (hit == 0) { flush_think_hold(true); trail = 0; st = St::ThinkCloseWs; }
|
||||
else if (hit > 0) {
|
||||
const std::string& marker = d.pattern(hit);
|
||||
if (!F.section_open_core.empty() && marker == F.section_open_core) {
|
||||
flush_think_hold(true);
|
||||
open_section();
|
||||
st = St::Text;
|
||||
} else if (!F.section_open_core.empty() && !section_active) {
|
||||
@@ -2754,10 +2878,17 @@ struct ReplyStream::Impl {
|
||||
return e;
|
||||
}
|
||||
|
||||
St after_lead() const {
|
||||
St after_lead() {
|
||||
if (F.f.has_reasoning() && P.opt.extract_reasoning)
|
||||
return F.open_core.empty() ? St::Think : St::ThinkOpen;
|
||||
return after_think();
|
||||
return after_no_block();
|
||||
}
|
||||
/* The reply did not open a reasoning block: its content_open header, when the format has one,
|
||||
* is matched from the first byte (the bytes of a failed reasoning opener are read again). */
|
||||
St after_no_block() {
|
||||
if (F.f.content_open.empty()) return after_think();
|
||||
lpos = 0;
|
||||
return St::ContentOpen;
|
||||
}
|
||||
St after_think() const { return P.opt.response_format ? St::RfWs : St::Text; }
|
||||
|
||||
@@ -2887,6 +3018,14 @@ struct ReplyStream::Impl {
|
||||
rerun();
|
||||
}
|
||||
if (st == St::ObjStr || st == St::ObjQStr) str_flush();
|
||||
/* The reply ended inside a header that never completed: its bytes are the reply. */
|
||||
while (!F.f.content_open.empty() && !lhold.empty() &&
|
||||
(st == St::ContentOpen || st == St::ThinkOpen)) {
|
||||
st = st == St::ThinkOpen ? after_no_block() : after_think();
|
||||
read_again(lhold);
|
||||
lhold.clear();
|
||||
rerun();
|
||||
}
|
||||
while (in_loose_attempt()) {
|
||||
fail_attempt();
|
||||
rerun();
|
||||
@@ -2935,6 +3074,7 @@ struct ReplyStream::Impl {
|
||||
}
|
||||
hold.clear();
|
||||
ds = 0;
|
||||
if (think_hold_on) flush_think_hold(true);
|
||||
if (!think_text) think_pend.clear();
|
||||
content.finish(msg.content);
|
||||
if (cur >= 0) publish(cur, true);
|
||||
|
||||
Reference in new issue
Block a user