radiance 1.0.12

- Wrong answers under concurrency on models with gated delta net layers (Qwen3.8-Flash-Next,
  Qwen3.8-27B, Qwen3.6-35B-A3B). A conv state slot was one entry wider in the allocation than in
  the state the kernels index, so clearing the slot a newly admitted request was given -- and a
  prefix-cache checkpoint's save and restore -- reached into the next request's conv and n-gram
  windows. A request decoding beside an admission then lost part of its recent context: a right
  first token followed by a context-free continuation ("1. **Identify the numbers..." for "What
  is 65 times 3?"), repeated or skipped digits. A single request was never affected. One
  definition of the slot now, and the server refuses to start if the allocation and the kernels
  ever disagree on it. Present since 1.0.0; reported with a strict concurrent sanity check.
- --num-speculative-tokens 0 no longer stops the engine at the first multi-sequence decode step:
  an all-reduce argument struct's padding was uninitialised, and a recorded pass's audit read it
  as a changed argument.
This commit is contained in:
Deadcode committed 2026-10-05 18:27:23 +02:00
1 parent 469441d90f
commit a4845834ea
10 files changed
+106 -31

No files matched your search

+19 -2
View File
@@ -191,8 +191,7 @@ int KVManager::plan_groups(const std::vector<KVGroupInfo>& groups, const Config&
* a change of read offset rather than a recompute (spec §10). The engine's
* contract is that the kernel pair supports that; the manager's job is to make the
* slot big enough for it. */
p.conv_slots = (g.decl.conv_width > 0 ? g.decl.conv_width - 1 : 0)
+ (cfg.n_spec > 0 ? cfg.n_spec : 0);
p.conv_slots = conv_window_entries(g.decl, cfg.n_spec);
if (p.conv_slots <= 0) {
RAD_ERR("KV group '%s': conv_width %lld with n_spec %d gives 0 slots",
p.name.c_str(), (long long)g.decl.conv_width, cfg.n_spec);
@@ -231,6 +230,24 @@ int KVManager::plan_groups(const std::vector<KVGroupInfo>& groups, const Config&
RAD_ERR("KV group '%s': per-sequence state computes to 0", p.name.c_str());
return RAD_E_INVAL;
}
/* THE SLOT THE KERNELS INDEX, which is the slot this manager has to hand out. The
* kernels lay slots out from the state tensor ([n_states, channels, conv_slots] or
* [n_states, n_head_kv, state_dim]); this manager lays them out from bytes_per_state,
* and clears, saves and restores slots in that layout. Two different sizes make every
* one of those touch a neighbouring sequence's state. */
const int64_t indexed =
(p.kind == RAD_KV_CONV
? p.conv_slots * g.decl.n_head_kv * g.decl.head_dim
: g.decl.n_head_kv * g.decl.state_dim[0] * g.decl.state_dim[1])
* elt * p.n_layers;
if (p.bytes_per_state != indexed) {
RAD_ERR("KV group '%s': %lld bytes a sequence are allocated, and the state the "
"kernels index is %lld bytes over its %lld layers -- the slot this manager "
"clears, checkpoints and restores would not be the slot the kernels read",
p.name.c_str(), (long long)p.bytes_per_state, (long long)indexed,
(long long)p.n_layers);
return RAD_E_SHAPE;
}
/* Exactly one slot per concurrent sequence, times whatever the kernel needs beside
* it. Not a heuristic: a sequence owns exactly one recurrent state, so max_seqs is
* the count of LOGICAL states, full stop. */