MTP coupling on qwen35_fp8's 2-bit draft head; libxe2 rows for the coupling ops

- arch: under --draft-coupling the MtpBlockFP8 draft head keeps the 2-bit logits' top 8,
  rescores them against the trunk's head (logit_rerank) and runs one mtp_couple_propose a
  round, as the Flash-Next head does; qwen35_fp8 declares the draw/state planes and a
  pitch-8 proposal. Off, nothing changes.
- libxe2: device rows for mtp_couple_propose / mtp_couple_verify, a work-item a row over
  spechub's own row helpers and argument readers (built into xe2_couple.cpp).
- spechub: mtp_couple_propose takes an optional q_temp (Q = softmax(score / q_temp)); exact at
  any value. RADIANCE_MTP_Q_TEMP sets it on qwen35_fp8 (default 1: 1.0 > 0.7 > 0.5 here).

w4a16-rtn-mtp4, depth 7 adaptive, temperature 0.7: decode proxy 76.9 -> 78.8 tok/s,
BetterBench decode 80.5 -> 81.7; greedy 8/8 identical with coupling on. Host tests
(spechub|couple|abi|mtp) 7/7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-11-02 05:45:50 +01:00
1 parent bfb1ebd1dd
commit 175f0bbd33
8 files changed
+160 -15

No files matched your search

+6 -3
View File
@@ -13,7 +13,7 @@ namespace {
#define PI(k) { k, RAD_P_INT, RAD_REQUIRED, 0 }
const RadParamSpec kProposeParams[] = {
PI("M"), PI("n_vocab"), PI("round"), PI("max_rounds"),
PI("M"), PI("n_vocab"), PI("round"), PI("max_rounds"), { "q_temp", RAD_P_F64, RAD_OPTIONAL, 0 },
};
const RadParamSpec kVerifyParams[] = { PI("M"), PI("n_cand"), PI("n_vocab") };
const RadParamSpec kDflashParams[] = {
@@ -58,8 +58,9 @@ const RadOperandSpec kDflashOperands[] = {
};
const RadOpSchema kSchemas[] = {
{ "mtp_couple_propose", kProposeParams, 4, kProposeOperands, 5,
"Linear MTP round `round`: x~Q, Q = FP64 T1 softmax of the final top8 scores; x into idx "
{ "mtp_couple_propose", kProposeParams, 5, kProposeOperands, 5,
"Linear MTP round `round`: x~Q, Q = FP64 softmax of the final top8 scores / q_temp (default "
"1); x into idx "
"column 0 and the state into state[round-1][row]. mode0 rows keep column 0 (status 0); bad "
"ids/scores or seq_ids != draw.card keep it too (status -1)." },
{ "mtp_couple_verify", kVerifyParams, 3, kVerifyOperands, 5,
@@ -230,6 +231,8 @@ int rad_mtp_couple_propose_args(const RadArgs* a, RadMtpCoupleProposeCall* out)
c.M = M;
c.vocab = v;
c.round = (int)rad_param_geti(a->p, a->n_p, "round", 0);
c.q_temp = (float)rad_param_getf(a->p, a->n_p, "q_temp", 1.0);
if (!(c.q_temp > 0.0f) || c.q_temp != c.q_temp || c.q_temp > 1e6f) return RAD_E_INVAL;
c.idx = (int32_t*)a->t[0].data;
c.val = (const float*)a->t[1].data;
c.card = (const int32_t*)a->t[2].data;