radiance 1.4.0

- Qwen3.8-Flash-Next on one card: the heat engine moves 64 experts a step (was 8), its copies and
  the prefill's expert staging run on the card's DMA engines instead of as copy kernels, and at
  decode the next layer's likeliest experts are copied onto the card ahead of its GEMMs. Against
  1.3.0 at --tp 1: prefill +17-20% from 8K tokens up, throughput under load +16-20%
- deploy/compose/flashnext-tp1.yaml: Qwen3.8-Flash-Next on one card and 64 GB of host RAM
  (4096-token prefill steps, 4 sequences, a 301K-token cache)
- #61: --busy-prefill-chunk (default auto): a long prefill leaves the rest of the step to the
  requests decoding beside it and to new arrivals, instead of taking all of it (baKon)
- LiquidAI's LFM2 and LFM2-VL, and d1's /v1/systemone (after zivius's PR #50)
- a startup report: every option with its value and where it came from, the hardware, and what
  on it costs speed with the fix; /diagnostics serves it (behind the API key; without one, only
  to the same machine)
- #69: a GPU memory fault names the buffer and kernel argument behind it and ends the server at
  once (exit status 70), instead of hanging or writing a core of tens of gigabytes
- #64: a card without Resizable BAR is refused at startup, naming what to turn on, instead of
  crashing at the first launch
- the image is built with ROCm 10.1 (the host's amdgpu driver must support it), with ROCm's
  libLLVM rebuilt so the same source compiles to the same kernels every time; a source build
  takes ROCm 10.1 or 7.2
- #71: the image ships curl, jq and a CA bundle, so --model <HF repo id> works in the container,
  and hfget.sh runs under its busybox (baKon)
- --profile-ops shows how long each op's lane sat idle before it; cardclock.py skips an
  integrated GPU instead of stopping
This commit is contained in:
Deadcode committed 2026-10-12 11:46:14 +02:00
1 parent d5b65cddc6
commit dc339b4cd2
153 files changed
+12956 -1067

No files matched your search

+65
View File
@@ -8,6 +8,9 @@
#include "ref_common.h"
#include "ref_ops.h"
#include <algorithm>
#include <vector>
using namespace ref;
/* Rows of a tensor read as [rows, n]. `n` is a declared parameter and the row count is whatever
@@ -188,6 +191,68 @@ int ref_grid_embed(const RadArgs* a, RadStream) {
return RAD_OK;
}
/* grid_embed_aa: the table resampled as torch's F.interpolate(mode="bilinear", align_corners=False,
* antialias=True) does it -- SigLIP2's position embedding. Per axis a triangle filter on half-pixel
* centres, widened by the scale when shrinking, its taps inside the table normalised to sum to one.
* Separable, f32 throughout, rounded once before the add. A coordinate outside its grid is clamped
* into it, so every input is defined. */
static void aa_taps(int64_t at, int64_t size, int64_t side, float* w, int64_t* lo, int64_t* cnt) {
if (size < 1) size = 1;
at = at < 0 ? 0 : (at >= size ? size - 1 : at);
const float scale = (float)side / (float)size;
const float support = scale > 1.0f ? scale : 1.0f, inv = 1.0f / support;
const float center = scale * ((float)at + 0.5f);
int64_t a = (int64_t)(center - support + 0.5f), b = (int64_t)(center + support + 0.5f);
if (a < 0) a = 0;
if (b > side) b = side;
float total = 0.0f;
for (int64_t j = a; j < b; ++j) {
const float d = std::fabs(((float)j - center + 0.5f) * inv);
w[j - a] = d < 1.0f ? 1.0f - d : 0.0f;
total += w[j - a];
}
for (int64_t j = a; j < b; ++j) w[j - a] = total != 0.0f ? w[j - a] / total : 0.0f;
*lo = a;
*cnt = b > a ? b - a : 0;
}
int ref_grid_embed_aa(const RadArgs* a, RadStream) {
if (!have(a, 3)) return RAD_E_INVAL;
const RadTensor *x = &a->t[0], *tab = &a->t[1], *crd = &a->t[2];
const int64_t n = p_int(a, "n", tab->rank ? tab->shape[tab->rank - 1] : 0);
const int64_t side = p_int(a, "side", 0);
if (n <= 0 || side <= 0 || numel(tab) < side * side * n) return RAD_E_SHAPE;
const int64_t rows = rows_of(x, n);
if (rows <= 0 || crd->rank != 2 || crd->shape[0] < 4 || crd->shape[1] < rows)
return RAD_E_SHAPE;
const int64_t cs = crd->stride[0], ms = crd->stride[1];
const int64_t ts = laststride(tab);
#pragma omp parallel for schedule(static)
for (int64_t r = 0; r < rows; ++r) {
int64_t g[4];
for (int c = 0; c < 4; ++c) g[c] = ld_int(crd->dtype, crd->data, c * cs + r * ms);
std::vector<float> wh((size_t)side), ww((size_t)side);
int64_t h0 = 0, nh = 0, w0 = 0, nw = 0;
aa_taps(g[0], g[2], side, wh.data(), &h0, &nh);
aa_taps(g[1], g[3], side, ww.data(), &w0, &nw);
const int64_t xb = rowoff(x, r, n), xs = laststride(x);
for (int64_t i = 0; i < n; ++i) {
float acc = 0.0f;
for (int64_t y = 0; y < nh; ++y) {
float row = 0.0f;
for (int64_t c = 0; c < nw; ++c)
row += ldt(tab, rowoff(tab, (h0 + y) * side + w0 + c, n) + i * ts) *
ww[(size_t)c];
acc += row * wh[(size_t)y];
}
const float pe = round_to(x->dtype, acc);
stt(x, xb + i * xs, ldt(x, xb + i * xs) + pe);
}
}
return RAD_OK;
}
/* ------------------------------------------------------------------ add / mul */
/* Elementwise over the output's extent. `b` may carry one row instead of all of them, so a bias
* add is this op rather than a second one: an operand with exactly `n` elements against an output