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
Deadcode ddcb9c69bb radiance 2.0.0
Radiance becomes a multi-model engine: one process serves several models behind one port, loads
each when a request names it, parks it in host memory or restores it from its container, and
shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the
command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP).

Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an
int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block
FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such
weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5,
Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B,
the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0
serves all of them.

Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new
Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill
reworked, and a reworked adaptive draft window.

Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its
configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool
in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server,
each accelerator's memory by model, model states over time.

Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by
AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests
keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410);
eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d
large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi
(#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon
(#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and
multi-model serving as asked for in #367 and #109.

Plugin ABI 39: out-of-tree plugins need to be rebuilt.

Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
2026-11-14 22:32:28 +01:00

113 lines
4.3 KiB
C++

/* vae_geom_test.cpp -- the encode geometry (arch/minimaxh3/rad_vae_geom.cpp) against golden vectors
* produced by the reference VAEs themselves.
*
* The TU is pure host arithmetic, so it is compiled straight in here -- no rad_core, no device.
* tests/data/vae_geom/golden.json comes from gen_golden.py, which runs the reference's encoders on
* CPU (video: EncoderFCN3D and the wrapper's own encode(), encode_temporal() and tiled_encode()
* with the reference's constructor arguments; audio: the DAC encoder). The latent counts below are
* the networks' own output shapes and the constants the reference's own tables, so a mismatch is
* the port disagreeing with the model.
*/
#include "rad_test.h"
#include "rad_vae_geom.h"
#include "util/json.h"
using Json = rad::Json;
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <string>
#include <vector>
using namespace minimaxh3;
namespace {
Json& golden() {
static Json g = [] {
std::ifstream f(std::string(RAD_VAE_GOLDEN) + "/golden.json");
if (!f.is_open()) {
fprintf(stderr, " FAIL golden.json missing -- regenerate with "
"tests/data/vae_geom/gen_golden.py\n");
std::exit(1);
}
return Json::parse(f);
}();
return g;
}
} /* namespace */
TEST(vae_encode_latent_counts) {
/* Every frame count goes through the reference encode() end to end: chunking, the padded last
* clip, the trailing drop. The spatial entries pin the ratio (generated at 32x32) and the
* latent width pins z_channels. */
for (const auto& c : golden()["video"]["encode"]) {
const int64_t t = c["T"];
const auto& z = c["z_shape"];
CHECK_EQ(vae_latent_frames(t), z[2].get<int64_t>());
CHECK_EQ(z[1].get<int64_t>(), 24);
CHECK_EQ(z[3].get<int64_t>() * kVaeRatio, 32);
CHECK_EQ(z[4].get<int64_t>() * kVaeRatio, 32);
}
}
TEST(vae_clip_chain_composes_with_encode) {
/* A full clip's latents times the clip count, less the drop, is the encode count; and a raw
* clip through the causal chain (the golden's tiled_encode cases: no chunking, no drop) has
* vae_clip_latents of its pixel frames. */
for (const auto& c : golden()["video"]["encode"]) {
const int64_t t = c["T"];
if (t < 2) continue;
const int64_t clips = (t + kVaeClipLength - 1) / kVaeClipLength;
CHECK_EQ(clips * vae_clip_latents(kVaeClipLength) - kVaeTokenDrop, c["z_shape"][2].get<int64_t>());
}
for (const auto& c : golden()["video"]["tiled_encode"])
CHECK_EQ(vae_clip_latents(c["x_shape"][2].get<int64_t>()), c["moments_shape"][2].get<int64_t>());
/* A single frame truncates its temporal taps instead of padding them. */
CHECK_EQ(vae_clip_latents(1), 1);
}
TEST(vae_audio_latents_match_encoder) {
/* The wrapper right-pads to the hop and the stride chain divides exactly: the reference
* encoder's own frame count is ceil(samples / 800). */
for (const auto& c : golden()["audio"]["latents"]) {
const int64_t s = c["samples"];
CHECK_EQ(vae_audio_latents(s), c["T"].get<int64_t>());
CHECK_EQ(vae_audio_latents(s) * kAudioHop, c["padded"].get<int64_t>());
}
}
TEST(vae_constants_are_the_reference_tables) {
/* The de-normalization the latents carry: doubles compare bit for bit, since the golden
* carries the same decimal literals. */
const auto& k = golden()["video"]["constants"];
const auto mean = k["latents_mean"].get<std::vector<double>>();
const auto stdv = k["latents_std"].get<std::vector<double>>();
CHECK_EQ(mean.size(), 24u);
CHECK_EQ(stdv.size(), 24u);
for (size_t i = 0; i < mean.size() && i < 24; ++i) {
CHECK(kVaeLatentsMean[i] == mean[i]);
CHECK(kVaeLatentsStd[i] == stdv[i]);
}
const auto pm = k["pixel_mean"].get<std::vector<double>>();
const auto ps = k["pixel_std"].get<std::vector<double>>();
for (size_t i = 0; i < 3; ++i) {
CHECK(kVaePixelMean[i] == pm[i]);
CHECK(kVaePixelStd[i] == ps[i]);
}
}
TEST(vae_geom_rejects_nonsense) {
CHECK_EQ(vae_latent_frames(0), -1);
CHECK_EQ(vae_latent_frames(-5), -1);
CHECK_EQ(vae_clip_latents(0), -1);
CHECK_EQ(vae_audio_latents(-1), -1);
CHECK_EQ(vae_audio_latents(0), 0);
}
RAD_TEST_MAIN()