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

+14 -7
View File
@@ -29,6 +29,7 @@
// last valid row, computes a result nobody stores, and never touches memory it does not own.
#include "r4d.h"
#include "r4d_gemm_args.h"
#include "r4d_common.h"
#include "r4d_gdn_wmma.h"
#include <hip/hip_bf16.h>
#include <cstdint>
@@ -95,27 +96,27 @@ __global__ __launch_bounds__(256) void r4d_gemm_bf16_nt_tiled_kernel(
for (int j = 0; j < TN; ++j) tot[i][j] = (v8f)(0.f);
}
uint4 ra[AL], rw[WL];
r4d_u32x4 ra[AL], rw[WL]; // registers; uint4 would sit in scratch
#pragma unroll
for (int i = 0; i < AL; ++i) ra[i] = *(const uint4*)(A + aoff[i]);
for (int i = 0; i < AL; ++i) ra[i] = *(const r4d_u32x4*)(A + aoff[i]);
#pragma unroll
for (int i = 0; i < WL; ++i) rw[i] = *(const uint4*)(W + woff[i]);
for (int i = 0; i < WL; ++i) rw[i] = *(const r4d_u32x4*)(W + woff[i]);
const int nk = K / BT_BK;
int left = spk; // k steps to the end of this split slice
for (int kt = 0; kt < nk; ++kt) {
__syncthreads(); // the previous tile's fragments are all read
#pragma unroll
for (int i = 0; i < AL; ++i) *(uint4*)adst[i] = ra[i];
for (int i = 0; i < AL; ++i) *(r4d_u32x4*)adst[i] = ra[i];
#pragma unroll
for (int i = 0; i < WL; ++i) *(uint4*)wdst[i] = rw[i];
for (int i = 0; i < WL; ++i) *(r4d_u32x4*)wdst[i] = rw[i];
__syncthreads();
if (kt + 1 < nk) {
const unsigned k1 = (unsigned)(kt + 1) * BT_BK;
#pragma unroll
for (int i = 0; i < AL; ++i) ra[i] = *(const uint4*)(A + aoff[i] + k1);
for (int i = 0; i < AL; ++i) ra[i] = *(const r4d_u32x4*)(A + aoff[i] + k1);
#pragma unroll
for (int i = 0; i < WL; ++i) rw[i] = *(const uint4*)(W + woff[i] + k1);
for (int i = 0; i < WL; ++i) rw[i] = *(const r4d_u32x4*)(W + woff[i] + k1);
}
#pragma unroll
for (int s = 0; s < BT_BK / 16; ++s) {
@@ -128,6 +129,12 @@ __global__ __launch_bounds__(256) void r4d_gemm_bf16_nt_tiled_kernel(
for (int i = 0; i < TM; ++i)
#pragma unroll
for (int j = 0; j < TN; ++j) acc[i][j] = mma(af[i], bf[j], acc[i][j]);
/* A K STEP'S FRAGMENT READS, THEN ITS PRODUCTS, as the scheduler's groups. Left to itself,
* gfx12's compiler spreads each step's LDS reads among the previous step's WMMAs and waits on
* them early; grouped, the 128 x 128 tile measured 6 to 9% faster than LLVM 22's schedule at
* Flash-Next's shapes (M 384 to 2048, K 2560, N 2560 and 10240). */
__builtin_amdgcn_sched_group_barrier(0x100, TM + TN, 0); /* DS reads */
__builtin_amdgcn_sched_group_barrier(0x008, TM * TN, 0); /* WMMA */
if constexpr (SPLIT) {
if (--left == 0) {
left = spk;