This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
radiance-sycl/core/sched/mtp_couple_plan.h
T
Deadcode 5a9ce4912b radiance 1.12.0
New models:
- Fish Audio drama-3: speech with speaker tags and inline direction, voices cloned from reference
  clips (the `references` field of /v1/audio/speech and the streaming session), two cards
- Gemma 4 E2B/E4B (KV-shared layers, per-layer embeddings, clipped vision linears), with
  NVIDIA-Nemotron-3.5-Bolt-E4B in bf16 with DFlash and vision on one card, and E4B recipes

Speed:
- MXFP4 GEMMs for one to 64 rows and a tiled prefill GEMM at TN=4 from 1024 rows: the 27B MXFP4
  with DFlash2 decodes about 1% faster at c1, 5% at c4 and 14% at c16
- The fp8 and int8 LM heads read their weight once for 65 to 128 rows
- A prefill step of one sequence runs in two pieces on a second lane at two ranks (qwen35_fp8,
  gemma3): a 45K-token prompt on the 27B fp8 in 15.1 s instead of 16.2 s
- Gemma 3's fused all-reduce junctions also under a lossy wire
- --draft-short-from N: a block drafter runs its shorter block from N decoding sequences on
  (off by default; with 8 on the 27B MXFP4: c8 +12%, c16 +18%, c64 +32%, c1 unchanged)
- --tp-attn-split rows: GLM-5.3-Flash's MLA attention split by rows over the ranks, 18 to 21%
  faster prefill; lossy, `heads` stays the default
- --draft-coupling on: Qwen3.8-Flash-Next's MTP drafter samples its proposals from its reranked
  top-8 and the target's draw is coupled to it; pays at high temperatures (c1 at T 1.0: 155 ->
  178 tok/s), costs at low ones; off by default

Features:
- Edited prompts on windowed models (Gemma 4) reuse their prefix: periodic window snapshots, and
  snapshot-backed prefix KV kept across recomputes (an edited tail on Gemma 4 31B: 96 s -> 2.6 s)
- DELETE /sessions/<label> and DELETE /sessions?id=<id> forget one stored conversation
- --state-cache-dtype f16: the delta-net state cache at half the memory (qwen35 plugins; lossy)

Fixes:
- A browser's CORS preflight allows DELETE

Changes: Plugin ABI 27: out-of-tree plugins must be rebuilt. The environment switches the PRs
added are flags now (--tp-attn-split, --draft-coupling, --state-cache-dtype).
2026-10-24 13:12:28 +02:00

54 lines
2.4 KiB
C++

/* mtp_couple_plan.h -- which draw the engine stages for each serial drafting row.
*
* Engine::stage_couple_draws (core/engine_draft.cpp) reads the draw of every sequence on its card
* from the step plan and, for each drafting row, the plan entry naming the row's sequence on the
* row's card. Pure host bookkeeping, so it is tested without a card.
*
* `by_card` has one entry per card slot, indexed by StepEntry::card in [0, max_seqs), the range of
* the StepSlots the advance reads.
*/
#pragma once
#include "batch.h"
#include "scheduler.h" /* Scheduler::SerialRow */
#include "rad_spechub.h"
#include <cstdint>
#include <string>
#include <vector>
namespace rad {
/* Fills `by_card[0, n_card)` from the plan and writes one draw per drafting row to `stage[0, n)`.
* RAD_OK, or RAD_E_STATE with `why` set: the plane is too small for the card slots, or a drafting
* row's card carries no plan entry naming its sequence (a stale row -- the plugin would refuse the
* staged draw, so it is refused here where the row can be named). */
inline int mtp_couple_plan_stage(const StepPlan& plan, int n_card, const Scheduler::SerialRow* rows,
int n, std::vector<RadMtpCoupleDraw>* by_card,
RadMtpCoupleDraw* stage, std::string* why) {
if (!by_card || !stage || !why) return RAD_E_INVAL;
if ((int)by_card->size() < n_card) {
*why = "the draw plane holds " + std::to_string(by_card->size()) +
" card slot(s), the step can use " + std::to_string(n_card);
return RAD_E_STATE;
}
for (int c = 0; c < n_card; ++c) (*by_card)[(size_t)c] = RadMtpCoupleDraw{};
for (const StepEntry& e : plan.e)
if (e.req && e.card >= 0 && e.card < n_card)
(*by_card)[(size_t)e.card] = { e.req->sp.seed, (uint64_t)e.req->output.size(), e.seq,
e.card, e.req->sp.greedy() ? 0u : 1u };
for (int i = 0; i < n; ++i) {
const Scheduler::SerialRow& row = rows[i];
if (row.card < 0 || row.card >= n_card || (*by_card)[(size_t)row.card].seq != row.seq) {
*why = "drafting row " + std::to_string(i) + " (sequence " + std::to_string(row.seq) +
", card " + std::to_string(row.card) + ") has no plan entry on its card";
return RAD_E_STATE;
}
stage[i] = (*by_card)[(size_t)row.card];
}
return RAD_OK;
}
} // namespace rad