radiance 1.0.7

- Chat responses report usage.completion_tokens_details.reasoning_tokens: how much of
  completion_tokens was the reasoning block. A reply that ran out of max_tokens inside <think>
  now reads as that, instead of as a model that answered nothing.
- thinking_token_budget (vLLM's name; thinking_budget is read as the same field) caps the
  reasoning. At that many tokens the block is closed and the model answers from what it has
  reasoned so far. It holds under speculative decoding and at any temperature.
  --thinking-token-budget sets the default for clients that send none.
- Every completion response carries a `timings` object in llama.cpp's shape: prompt and generated
  token counts, times and rates, and the speculative tokens drafted and accepted for that request.
  It is on the buffered response, on each streamed choice's final chunk and on the usage chunk,
  so a proxy such as llama-swap can read per-request speed. /metrics stays the aggregate.
- Peer-to-peer access between the cards is checked at launch. The all-reduce kernels need it; on
  a machine where the cards cannot reach each other's memory, startup stops and names device.p2p
  instead of the first all-reduce faulting or hanging. A kernel library can require it with a
  constraint on the new "device." keys, which match the machine and not the op's parameters.
- A pool allocation the driver refuses says why, with the card's free VRAM at that moment and,
  for the host pool, the pinned memory taken against the amdgpu limit (ttm.pages_limit). Every
  rank pins its own --host-pool-mib, so --tp 2 pins it twice.
This commit is contained in:
Deadcode committed 2026-10-04 21:23:07 +02:00
1 parent 6df26315b9
commit 966bda899a
39 files changed
+1304 -52

No files matched your search

+36
View File
@@ -849,6 +849,42 @@ static RadChatFormat qwen_abi() {
return c;
}
/* WHERE THE REPLY STARTS AGAINST ITS REASONING BLOCK, read from the generation prompt as the stream
* reads it: opened by the prompt, opened and closed again (thinking off), or not opened at all --
* and the markers trimmed of the whitespace that is optional to match. The engine counts and closes
* the block by these, so a reply this calls open has to be one the stream reads as reasoning. */
TEST(the_parser_says_whether_a_reply_starts_inside_its_reasoning_block) {
RadChatFormat c = qwen_abi();
ChatFormat f;
std::string why;
CHECK_OK(chat_format_from_abi(&c, &f, &why));
std::shared_ptr<const ReplyFormat> rf;
CHECK_OK(ReplyFormat::compile(f, &rf, &why));
struct Case { const char* prompt; bool open; };
for (const Case& k : { Case{ "<|im_start|>assistant\n<think>\n", true },
Case{ "<|im_start|>assistant\n<think>\n\n</think>\n\n", false },
Case{ "<|im_start|>assistant\n", false } }) {
ReplyOptions ro;
ro.generation_prompt = k.prompt;
std::shared_ptr<const ReplyParser> rp;
CHECK_OK(ReplyParser::create(rf, ro, &rp, &why));
const ReasoningMarkers m = rp->reasoning();
CHECK_EQ(m.open, std::string("<think>"));
CHECK_EQ(m.close, std::string("</think>"));
CHECK_EQ(m.starts_open, k.open);
const ReplyMessage r = reply_parse(*rp, "x</think>\n\ny");
CHECK_EQ(r.reasoning.empty(), !k.open);
}
ChatFormat none;
CHECK_OK(chat_format_from_template("", "", "", &none, &why, &why));
CHECK_OK(ReplyFormat::compile(none, &rf, &why));
std::shared_ptr<const ReplyParser> rp;
CHECK_OK(ReplyParser::create(rf, ReplyOptions{}, &rp, &why));
CHECK(rp->reasoning().close.empty());
CHECK(!rp->reasoning().starts_open);
}
/* A plugin that declares its model's format gets exactly what the template analysis derives for
* the same model: the same parser behaviour and the same grammar. */
TEST(a_declared_format_reads_and_constrains_like_the_derived_one) {