Archived
radiance 1.0.13
- Faster prefill on models with an MTP head (Qwen3.8-Flash-Next, Qwen3.6-35B-A3B). Every prefill chunk but a prompt's last runs the head only to leave its K and V behind, and the head no longer runs its expert layer and lm_head for nothing on those chunks. Flash-Next on two R9700: +1.4% at 8K tokens, +3.2% at 26K, +5.9% at 78K; text and decode unchanged. From Code000's opt33. - A request log at the info level: one line when a request is admitted (endpoint, peer, message and tool counts, prompt tokens, max_tokens), one when it ends (finish reason, cached prompt, generated and reasoning tokens, time to first token, decode rate), and every refusal with its status and peer -- a wrong API key included. No prompt text at info. (baKon) - deploy/grafana: a dashboard for /metrics on Prometheus or VictoriaMetrics. (keptn42) - Three-rank tensor parallelism for Qwen3.8-Flash-Next: the all-reduce and all-gather at three ranks, the vocabulary split by 128-row blocks where the world does not divide it, and tools/pad_tp.py to pad the checkpoint's head counts to a world of three -- docs/TP3.md. (baKon)
This commit is contained in:
1 parent
6b394ccca6
commit
d0f639bd06
16 files changed
+121
-62
No files matched your search
+15
-3
@@ -1279,14 +1279,26 @@ int parse_chat_request(const std::string& body, const OaiDeps& d, const OaiLimit
|
||||
if (!it->is_object() || !it->contains("role") || it->at("role") != "user") continue;
|
||||
const auto cit = it->find("content");
|
||||
if (cit == it->end()) break;
|
||||
/* At most 160 bytes are kept, so no more than that is copied out of a message that
|
||||
* may be a whole document, and the cut lands on a UTF-8 lead byte: a log line split
|
||||
* inside a character is not valid text. */
|
||||
constexpr size_t kKeep = 160;
|
||||
std::string t;
|
||||
if (cit->is_string()) t = cit->get<std::string>();
|
||||
auto take = [&t](const std::string& s) {
|
||||
if (t.size() <= kKeep) t.append(s, 0, kKeep + 1 - t.size());
|
||||
};
|
||||
if (cit->is_string()) take(cit->get_ref<const std::string&>());
|
||||
else if (cit->is_array())
|
||||
for (const auto& part : *cit)
|
||||
if (part.is_object() && part.value("type", "") == "text")
|
||||
t += part.value("text", "");
|
||||
take(part.value("text", ""));
|
||||
for (char& c : t) if (c == '\n' || c == '\r' || c == '\t') c = ' ';
|
||||
if (t.size() > 160) { t.resize(157); t += "..."; }
|
||||
if (t.size() > kKeep) {
|
||||
size_t cut = kKeep - 3;
|
||||
while (cut > 0 && ((unsigned char)t[cut] & 0xC0) == 0x80) --cut;
|
||||
t.resize(cut);
|
||||
t += "...";
|
||||
}
|
||||
out->last_user = std::move(t);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user