Archived
radiance 1.1.0
- The VRAM split has no ratio: --expert-vs-cache-ratio is gone (now an unknown option). The experts keep what the pinned host pool cannot hold, the KV cache takes the rest and lends idle blocks to the experts. Flash-Next at tp2: 7.9 GiB of KV a card, up from 4.7. Startup, /stats, /metrics and the dashboard report the most the cache can hold. - Linear-state snapshots live in pinned host memory, not VRAM (--checkpoint-slots sizes the store). Prefix-cache misses on agent sessions fixed; a published conversation is no longer trimmed away. - Any world size from the shipped container (baKon): --tp 3 on Flash-Next with no padded checkpoint -- the attention world, uneven delta-net heads, the fill op. - Kernels (keptn42): moe_gemm_q decode loads and one-trip run search, hc_read's prefill form (+3.7% prefill at 18K), hc_up row groups up to eight, the fused router launch. Each is the rule where it was measured faster; no environment switches. - Tool calls: a typed argument is always JSON (Python True/None no longer leak into arguments -- Codeberg #21); nine further reply-parser fixes; the reply path inside a call is ~12x cheaper on the host. - The kernel changes: prefill +2-3% and decode -2% a step on 2x R9700 at tp2, identical text.
This commit is contained in:
1 parent
9f5feb24ee
commit
82b5835c02
101 files changed
+5105
-3767
No files matched your search
@@ -174,5 +174,63 @@ size_t json_stable_prefix(std::string_view s) {
|
||||
return n;
|
||||
}
|
||||
|
||||
bool json_quote_append(std::string& out, std::string_view s) {
|
||||
static const char kHex[] = "0123456789abcdef";
|
||||
const size_t mark = out.size();
|
||||
out.reserve(mark + s.size() + 2);
|
||||
out.push_back('"');
|
||||
const unsigned char* p = (const unsigned char*)s.data();
|
||||
const unsigned char* e = p + s.size();
|
||||
const unsigned char* run = p; /* [run, p) is verified and goes out as it is */
|
||||
while (p < e) {
|
||||
const unsigned char c = *p;
|
||||
if (c >= 0x80) {
|
||||
/* Length, and the range the SECOND byte is restricted to, which is what rejects
|
||||
* overlong forms, surrogates and anything past U+10FFFF without decoding. */
|
||||
size_t len;
|
||||
unsigned char lo = 0x80, hi = 0xBF;
|
||||
if (c >= 0xC2 && c <= 0xDF) len = 2;
|
||||
else if (c == 0xE0) { len = 3; lo = 0xA0; }
|
||||
else if (c >= 0xE1 && c <= 0xEC) len = 3;
|
||||
else if (c == 0xED) { len = 3; hi = 0x9F; }
|
||||
else if (c >= 0xEE && c <= 0xEF) len = 3;
|
||||
else if (c == 0xF0) { len = 4; lo = 0x90; }
|
||||
else if (c >= 0xF1 && c <= 0xF3) len = 4;
|
||||
else if (c == 0xF4) { len = 4; hi = 0x8F; }
|
||||
else len = 0;
|
||||
bool ok = len != 0 && (size_t)(e - p) >= len && p[1] >= lo && p[1] <= hi;
|
||||
for (size_t k = 2; ok && k < len; ++k) ok = p[k] >= 0x80 && p[k] <= 0xBF;
|
||||
if (!ok) {
|
||||
out.resize(mark);
|
||||
return false;
|
||||
}
|
||||
p += len;
|
||||
continue;
|
||||
}
|
||||
if (c >= 0x20 && c != '"' && c != '\\') {
|
||||
++p;
|
||||
continue;
|
||||
}
|
||||
out.append((const char*)run, (size_t)(p - run));
|
||||
switch (c) {
|
||||
case '"': out += "\\\""; break;
|
||||
case '\\': out += "\\\\"; break;
|
||||
case '\b': out += "\\b"; break;
|
||||
case '\t': out += "\\t"; break;
|
||||
case '\n': out += "\\n"; break;
|
||||
case '\f': out += "\\f"; break;
|
||||
case '\r': out += "\\r"; break;
|
||||
default: {
|
||||
const char u[6] = { '\\', 'u', '0', '0', kHex[c >> 4], kHex[c & 15] };
|
||||
out.append(u, 6);
|
||||
}
|
||||
}
|
||||
run = ++p;
|
||||
}
|
||||
out.append((const char*)run, (size_t)(p - run));
|
||||
out.push_back('"');
|
||||
return true;
|
||||
}
|
||||
|
||||
} /* namespace server */
|
||||
} /* namespace rad */
|
||||
Reference in new issue
Block a user