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/tests/spechub_wiring_test.cpp
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

116 lines
4.2 KiB
C++

/* spechub_wiring_test.cpp -- what the loader and the reference gate see of the spechub plugin.
*
* The device rows must be production rows and the host rows reference rows; were the whole
* library marked reference, the reference gate would refuse the coupled ops at bringup. The check
* loads the real DSO as the loader does (dlopen and the exported symbols) and asserts the domain
* and the reference answer per row. A host build has only the reference rows and must stay
* classified as such.
*/
#include "rad_test.h"
#include "rad_abi.h"
#include <dlfcn.h>
#include <map>
#include <string>
#include <vector>
namespace {
struct Plugin {
void* handle = nullptr;
const RadPluginInfo* (*info)() = nullptr;
int (*reference)() = nullptr;
int (*kern_ref)(int) = nullptr;
int (*count)() = nullptr;
const RadKernelInfo* (*at)(int) = nullptr;
bool open(const char* path) {
handle = dlopen(path, RTLD_NOW | RTLD_LOCAL);
if (!handle) return false;
info = (const RadPluginInfo* (*)())dlsym(handle, "rad_plugin_info");
reference = (int (*)())dlsym(handle, "rad_plugin_reference");
kern_ref = (int (*)(int))dlsym(handle, "rad_kernel_reference");
count = (int (*)())dlsym(handle, "rad_kernel_count");
at = (const RadKernelInfo* (*)(int))dlsym(handle, "rad_kernel_at");
return info && reference && count && at;
}
~Plugin() { if (handle) dlclose(handle); }
};
/* The rule rad_reference_ops applies, over the rows as the loader would classify them: an op is on
* the reference when no row for it is a non-reference row. */
std::vector<std::string> reference_only_ops(const Plugin& p, const std::vector<int>& is_ref) {
std::map<std::string, bool> has_real;
for (int i = 0; i < p.count(); ++i) {
const RadKernelInfo* k = p.at(i);
if (!k) continue;
bool& real = has_real[k->op];
real = real || !is_ref[(size_t)i];
}
std::vector<std::string> out;
for (const auto& kv : has_real)
if (!kv.second) out.push_back(kv.first);
return out;
}
} /* namespace */
TEST(spechub_wiring_the_device_rows_are_production_and_the_oracle_rows_are_reference) {
Plugin p;
REQUIRE(p.open(RAD_SPECHUB_LIB));
CHECK_EQ(p.info()->kind, (int)RAD_PLUGIN_KERNEL);
CHECK_EQ(std::string(p.info()->name), std::string("spechub"));
/* The per-row answer must exist: without it the loader falls back to the library answer, which
* is what mis-classified the device rows. */
REQUIRE(p.kern_ref != nullptr);
/* And the library as a whole is NOT a reference library -- otherwise the loader sorts it below
* the kernel libraries it serves beside and every row inherits the flag. */
CHECK_EQ(p.reference(), 0);
std::vector<int> is_ref;
int dev = 0, host = 0;
for (int i = 0; i < p.count(); ++i) {
const RadKernelInfo* k = p.at(i);
REQUIRE(k != nullptr);
const int r = p.kern_ref(i);
is_ref.push_back(r);
if (k->domain == RAD_DOMAIN_DEVICE) {
++dev;
/* A device row is a kernel, never a reference: this is the line that decides whether a
* coupled run may start at all. */
CHECK_EQ(r, 0);
CHECK(std::string(k->name).rfind("ref_", 0) != 0);
} else {
++host;
CHECK_EQ(k->domain, (int)RAD_DOMAIN_HOST);
/* The host oracle beside it keeps its reference status. */
CHECK_EQ(r, 1);
CHECK(std::string(k->name).rfind("ref_", 0) == 0);
}
}
CHECK_EQ(dev + host, p.count());
#ifdef RAD_SPECHUB_WITH_DEVICE
CHECK_EQ(dev, 2);
CHECK_EQ(host, 2);
#else
CHECK_EQ(dev, 0);
CHECK_EQ(host, 2);
#endif
/* Both ops must have at least one production row on a device build. This is the property the
* gate reads: with it, the coupling is servable without --debug-accept-reference-kernels. */
const std::vector<std::string> refonly = reference_only_ops(p, is_ref);
#ifdef RAD_SPECHUB_WITH_DEVICE
CHECK_EQ(refonly.size(), (size_t)0);
#else
/* No card: both ops are oracle-only, and the gate must still see them as such. */
CHECK_EQ(refonly.size(), (size_t)2);
#endif
}
RAD_TEST_MAIN()