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).
This commit is contained in:
137 files changed
+12959 -1126

No files matched your search

+53 -1
View File
@@ -855,7 +855,10 @@ int Checkpoint::open_safetensors(const std::string& path) {
RAD_TRY(meta_merge_generation_config(md, &meta_));
RAD_TRY(meta_merge_preprocessor_configs(md, &meta_));
if (!meta_dir_.empty() && !path_exists(dir_ + "/tokenizer.json")) tok_dir_ = meta_dir_;
if (!is_file && !is_index) RAD_TRY(add_companions());
if (!is_file && !is_index) {
RAD_TRY(add_companions());
RAD_TRY(add_torch_files());
}
/* FP8's block, where the checkpoint states one. */
if (const char* bs = meta_.get("quantization_config.weight_block_size")) {
long long r = 0, c = 0;
@@ -898,6 +901,55 @@ int Checkpoint::add_companions() {
return RAD_OK;
}
/* PyTorch checkpoints beside the safetensors (torch_zip.h): a model whose part ships only as a
* torch.save file, such as Fish Audio drama-3's codec.pth, read as data, never unpickled. Each is
* read under `<stem>.`, in name order. A file the weights-only reader refuses (a pickled training
* state, an optimiser) is not an error of the checkpoint, only of a plugin that maps its tensors,
* which then finds them absent; the warning says why. A torch copy of the model's own weights
* (`pytorch_model*.pth`, `consolidated*.pth`) is passed over, as the safetensors are read. */
int Checkpoint::add_torch_files() {
std::vector<std::string> files;
std::error_code ec;
for (const auto& de : std::filesystem::directory_iterator(dir_, ec)) {
if (!de.is_regular_file(ec)) continue;
const std::string f = de.path().filename().string();
if (f.size() <= 4 || f.compare(f.size() - 4, 4, ".pth") != 0) continue;
if (f.rfind("pytorch_model", 0) == 0 || f.rfind("consolidated", 0) == 0) continue;
files.push_back(f);
}
std::sort(files.begin(), files.end());
for (const std::string& f : files) {
auto tz = std::make_unique<TorchZipFile>();
std::string why;
const std::string path = dir_ + "/" + f;
if (tz->open(path, &why) < 0) {
RAD_WARN("%s: not read (%s); a plugin that maps its tensors will not find them",
path.c_str(), why.c_str());
continue;
}
const std::string prefix = f.substr(0, f.size() - 4) + ".";
for (const TorchTensor& t : tz->tensors()) {
if (index_.count(prefix + t.name)) {
RAD_ERR("%s: '%s%s' is already in the checkpoint", path.c_str(), prefix.c_str(),
t.name.c_str());
return RAD_E_FORMAT;
}
SrcTensor s;
s.name = prefix + t.name;
s.rad_dtype = t.dtype;
s.shape = t.shape;
s.data = t.data;
s.bytes = (int64_t)t.bytes;
index_.emplace(s.name, tensors_.size());
tensors_.push_back(std::move(s));
}
RAD_INFO("%s: %zu tensors under '%s', read from the pickle as data", path.c_str(),
tz->tensors().size(), prefix.c_str());
torch_.push_back(std::move(tz));
}
return RAD_OK;
}
/* Which published quantisation this is, from quantization_config alone; import_piece checks the
* tensors weight by weight, refusing a file at the first weight that disagrees. */
void Checkpoint::detect_import() {