radiance 1.7.0

- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves
  every shipped container
- Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime
- /v1/messages works with Claude Code as it ships (gearwave00001)
- a long agent conversation keeps its cached history when the client rewrites its last turn
  (manueloverride)
- a stream's first event goes out with the first token, so llama-benchy measures prefill right
- opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42)
- four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b)
- NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA
  adapters (baKon)
- many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool
  arguments and the CPU's vision and audio encoders
- plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
This commit is contained in:
Deadcode committed 2026-10-16 18:25:18 +02:00
1 parent b068190326
commit 1e968f6e1d
739 files changed
+128447 -84632

No files matched your search

+20 -21
View File
@@ -1,25 +1,24 @@
// r4d_hc_fp8.h -- the STORED ROW GEOMETRY of hc_read's two mixing matrices at E4M3, and nothing
// else. Pure C++: no HIP, no r4d.h, so the host layout hook (r4d_fp8_layout.cpp), the kernels
// (r4d_hc_bf16.hip) and the selftest derive a row from the same lines.
// r4d_hc_fp8.h -- stored row geometry of hc_read's two mixing matrices at E4M3. Pure C++ (no HIP,
// no r4d.h), so the host layout hook (r4d_fp8_layout.cpp), the kernels (r4d_hc_bf16.hip) and the
// selftest share one definition.
//
// A stored row is [K E4M3 codes][K/G f32 scales][pad to 16 bytes], one row after another, for the
// reason r4d_rad_layout_fp8_logits gives: the scales ride in the row that uses them, so a row is
// self-contained and a kernel finds its scales at a fixed offset from its codes.
// A stored row is [K E4M3 codes][K/G f32 scales][pad to 16 bytes], rows back to back. As in
// r4d_rad_layout_fp8_logits, the scales ride in their row, so a kernel finds them at a fixed
// offset from its codes.
//
// THE GROUP IS A PROPERTY OF THE KERNEL THAT READS THE ROW, not a tuning choice, and the two
// matrices get different ones for that reason:
// The group size is set by the kernel that reads the row, not by tuning:
//
// mix_down [lowrank rows, K = hc*n] G = 128. A wave walks the row in 256-element steps with
// eight codes a lane, so every lane's eight sit inside one group and a step needs two
// eight codes a lane, so each lane's eight sit in one group and a step needs two
// scales a wave.
// mix_up [hc*n rows, K = lowrank] G = K/4. Four threads share a row, each taking one
// contiguous quarter of it -- 80 codes at lowrank 320 -- so a thread's quarter IS its
// group and it multiplies by one scale after its whole partial sum. lowrank must be a
// multiple of 64 for the quarter to be sixteen-code loads.
// contiguous quarter (80 codes at lowrank 320), so a thread's quarter is its group and
// it applies one scale after its partial sum. lowrank must be a multiple of 64 so a
// quarter splits into sixteen-code loads.
//
// Both are FINER than the 128 x 128 blocks the GEMMs use, which is deliberate: these rows are
// read against a normalised stream whose every element matters, and a per-row group costs one f32
// per G codes -- 3.1% of mix_down's bytes and 5% of mix_up's.
// Both are finer than the GEMMs' 128 x 128 blocks on purpose: these rows meet a normalised stream
// where every element matters, and a per-row group costs one f32 per G codes (3.1% of mix_down's
// bytes, 5% of mix_up's).
#pragma once
#include <cstdint>
@@ -27,17 +26,17 @@ namespace r4d_hc8 {
constexpr int64_t kDownGroup = 128;
// constexpr and not merely inline, which is what makes them callable from device code too: the
// compiler treats a constexpr function as both host and device.
// constexpr rather than inline so device code can call them: a constexpr function is implicitly
// host and device.
constexpr int64_t down_group(int64_t /*K*/) { return kDownGroup; }
constexpr int64_t up_group(int64_t K) { return K / 4; }
// Whether a K can be stored with the given group at all. The kernels' loads are what decide it:
// sixteen codes at a time, a group a whole number of those.
// Whether K can be stored with group G: the kernels load sixteen codes at a time, and a group must
// be a whole number of those.
constexpr bool group_ok(int64_t K, int64_t G) { return G > 0 && G % 16 == 0 && K % G == 0; }
// The BYTES one stored row occupies, and where its pad starts. The row starts 16-byte aligned so
// every code load is a uint4 or a uint2 at a 16- or 8-byte boundary.
// Bytes one stored row occupies, and where its pad starts. Rows start 16-byte aligned so every
// code load is a uint4 or uint2 at a 16- or 8-byte boundary.
constexpr int64_t row_used(int64_t K, int64_t G) { return K + 4 * (K / G); }
constexpr int64_t row_bytes(int64_t K, int64_t G) { return (row_used(K, G) + 15) & ~(int64_t)15; }