Archived
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).
98 lines
3.6 KiB
C++
98 lines
3.6 KiB
C++
/* plugin/spechub/exports.cpp -- the plugin's export block.
|
|
*
|
|
* The whole kernel-plugin set (schema count/at, kernel count/at, ABI version, info) and nothing else.
|
|
* The rows themselves, their schemas and their argument readers are in spechub.cpp; the launches are
|
|
* spechub.hip (device) and ref_spechub.cpp (host).
|
|
*
|
|
* Reference status is per row: the library carries device rows and their host oracle, so
|
|
* `rad_kernel_reference` marks the device rows 0 and the host rows 1, and `rad_plugin_reference`
|
|
* stays 0. Marking the whole library would make the reference gate refuse the device rows. On a
|
|
* machine with no card only the reference rows exist, and the gate refuses the coupling there.
|
|
*
|
|
* The ops are declared only under --draft-coupling on; the plugin never reads the flag.
|
|
*/
|
|
#include "spechub.h"
|
|
|
|
#ifdef RAD_SPECHUB_WITH_DEVICE
|
|
#include "../../libr4d/r4d_emit.h" /* only for the three globals it declares */
|
|
|
|
/* r4d_emit.h's dispatch recorder, defined here because plugins load RTLD_LOCAL and cannot
|
|
* resolve libr4d's copy. Nothing in this plugin sets the log, so the recorder stays inert. */
|
|
const void** r4d_dispatch_log = nullptr;
|
|
int r4d_dispatch_cap = 0;
|
|
int r4d_dispatch_n = 0;
|
|
#endif
|
|
|
|
namespace {
|
|
const RadPluginInfo kInfo = {
|
|
RAD_PLUGIN_KERNEL, "spechub", "0.1.0",
|
|
"Linear-MTP maximal coupling: a Q draw per round and the coupled target verify", "gfx1201",
|
|
};
|
|
} /* namespace */
|
|
|
|
extern "C" uint32_t rad_plugin_abi_version(void) { return RAD_ABI_VERSION; }
|
|
extern "C" const RadPluginInfo* rad_plugin_info(void) { return &kInfo; }
|
|
/* Mixed library: 0, and the per-row answer below does the classifying. */
|
|
extern "C" int rad_plugin_reference(void) { return 0; }
|
|
|
|
/* Row layout is [device 0, device 1, ref 0, ref 1] with a card, [ref 0, ref 1] without. The
|
|
* device rows are the production kernels; the host rows are the oracle rad-kbench checks them
|
|
* against and the only thing a card-less machine can run. */
|
|
extern "C" int rad_kernel_reference(int i) {
|
|
#ifdef RAD_SPECHUB_WITH_DEVICE
|
|
return (i == 0 || i == 1) ? 0 : 1;
|
|
#else
|
|
(void)i;
|
|
return 1;
|
|
#endif
|
|
}
|
|
|
|
extern "C" int rad_kernel_schema_count(void) { return rad_spechub_schema_count(); }
|
|
extern "C" const RadOpSchema* rad_kernel_schema_at(int i) { return rad_spechub_schema_at(i); }
|
|
|
|
/* Two device rows and the two host references beside them, in that order. A card-less machine loads
|
|
* the same library and resolves only the reference rows. */
|
|
extern "C" int rad_kernel_count(void) {
|
|
#ifdef RAD_SPECHUB_WITH_DEVICE
|
|
return 4;
|
|
#else
|
|
return 2;
|
|
#endif
|
|
}
|
|
|
|
extern "C" const RadKernelInfo* rad_kernel_at(int i) {
|
|
const int op = i & 1;
|
|
#ifdef RAD_SPECHUB_WITH_DEVICE
|
|
if (i == 0 || i == 1) {
|
|
static const RadKernelInfo r[2] = {
|
|
rad_spechub_row(0, rad_mine_mtp_couple_propose_launch),
|
|
rad_spechub_row(1, rad_mine_mtp_couple_verify_launch),
|
|
};
|
|
return &r[i];
|
|
}
|
|
#endif
|
|
static const RadKernelInfo ref[2] = {
|
|
[] {
|
|
RadKernelInfo x = rad_spechub_row(0, rad_ref_mtp_couple_propose);
|
|
x.name = "ref_mtp_couple_propose";
|
|
x.domain = RAD_DOMAIN_HOST;
|
|
x.priority = 0;
|
|
return x;
|
|
}(),
|
|
[] {
|
|
RadKernelInfo x = rad_spechub_row(1, rad_ref_mtp_couple_verify);
|
|
x.name = "ref_mtp_couple_verify";
|
|
x.domain = RAD_DOMAIN_HOST;
|
|
x.priority = 0;
|
|
return x;
|
|
}(),
|
|
};
|
|
#ifdef RAD_SPECHUB_WITH_DEVICE
|
|
if (i < 2 || i > 3) return nullptr;
|
|
return &ref[op];
|
|
#else
|
|
if (i < 0 || i > 1) return nullptr;
|
|
return &ref[i];
|
|
#endif
|
|
}
|