Archived
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:
1 parent
d5b65cddc6
commit
dc339b4cd2
153 files changed
+12956
-1067
No files matched your search
@@ -102,21 +102,37 @@ __global__ __launch_bounds__(256) void r4d_qk_norm_rope_gate_kernel(
|
||||
auto gain = [&](int i) -> float {
|
||||
return w_f32 ? ((const float*)w)[i] : __bfloat162float(((const __hip_bfloat16*)w)[i]);
|
||||
};
|
||||
auto normed = [&](int i, float inv) -> float {
|
||||
const float v = __bfloat162float(in[i]);
|
||||
// ROUNDED TO bf16 BEFORE THE ROTATION, which is the whole bit-identity argument at the top of
|
||||
// this file: the reference stores the norm and RoPEs what it reads back.
|
||||
return __bfloat162float(__float2bfloat16(v * inv * (gain(i) + wadd)));
|
||||
// ROUNDED TO bf16 BEFORE THE ROTATION, which is the whole bit-identity argument at the top of
|
||||
// this file: the reference stores the norm and RoPEs what it reads back.
|
||||
auto normed = [&](float v, float g, float inv) -> float {
|
||||
return __bfloat162float(__float2bfloat16(v * inv * (g + wadd)));
|
||||
};
|
||||
|
||||
// EVERYTHING THE ROTATION READS IS LOADED HERE, ahead of the reduction, so it is in flight while
|
||||
// the sum of squares goes round: this lane's element and gain, its partner's, and its cos and
|
||||
// sin. None of it depends on the norm. The indices are clamped rather than the loads guarded --
|
||||
// a lane past the head reads its last element, a lane past the rotary range its own element and
|
||||
// column 0 of the table (rot >= 2, so the table has one) -- and the values are used only where
|
||||
// the guards below say.
|
||||
const int tc = t < HD ? t : HD - 1;
|
||||
const bool rl = t < rot, first = t < half;
|
||||
const int pt = rl ? (first ? t + half : t - half) : tc;
|
||||
const int ci = rl ? (first ? t : t - half) : 0;
|
||||
const size_t co = (size_t)p * rot;
|
||||
const float vt = __bfloat162float(in[tc]), gt = gain(tc);
|
||||
const float vp = __bfloat162float(in[pt]), gp = gain(pt);
|
||||
const float c = cs_f32 ? csf[co + ci] : __bfloat162float(csb[co + ci]);
|
||||
const float s = cs_f32 ? csf[co + half + ci] : __bfloat162float(csb[co + half + ci]);
|
||||
|
||||
float ss = 0.0f;
|
||||
if (t < HD) { const float v = __bfloat162float(in[t]); ss = v * v; }
|
||||
if (t < HD) ss = vt * vt;
|
||||
// rmsnorm_bf16's block_sum, transcribed: the wave butterfly, then the wave partials summed in
|
||||
// ASCENDING index order. Both halves matter -- an accumulation over the same values in a
|
||||
// different order breaks the bit-equality argument above.
|
||||
// different order breaks the bit-equality argument above. The barrier orders the partials in LDS
|
||||
// and nothing else, so the loads above stay in flight across it.
|
||||
ss = r4d_wave_sum(ss);
|
||||
if ((t & 31) == 0) lds[t >> 5] = ss;
|
||||
__syncthreads();
|
||||
lds_barrier();
|
||||
float sum = 0.0f;
|
||||
#pragma unroll
|
||||
for (int wv = 0; wv < THR / 32; ++wv) sum += lds[wv];
|
||||
@@ -124,15 +140,9 @@ __global__ __launch_bounds__(256) void r4d_qk_norm_rope_gate_kernel(
|
||||
|
||||
float res = 0.0f;
|
||||
if (t < HD) {
|
||||
res = normed(t, inv);
|
||||
if (t < rot) {
|
||||
const bool first = t < half;
|
||||
const int pt = first ? t + half : t - half;
|
||||
const int ci = first ? t : t - half;
|
||||
const size_t co = (size_t)p * rot;
|
||||
const float c = cs_f32 ? csf[co + ci] : __bfloat162float(csb[co + ci]);
|
||||
const float s = cs_f32 ? csf[co + half + ci] : __bfloat162float(csb[co + half + ci]);
|
||||
const float xp = normed(pt, inv);
|
||||
res = normed(vt, gt, inv);
|
||||
if (rl) {
|
||||
const float xp = normed(vp, gp, inv);
|
||||
res = first ? (res * c - xp * s) : (xp * s + res * c);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user