Archived
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:
1 parent
b068190326
commit
1e968f6e1d
739 files changed
+128447
-84632
No files matched your search
+18
-21
@@ -1,17 +1,15 @@
|
||||
#pragma once
|
||||
// r4d_ar_hc.h: the per-word arithmetic of the all-reduces that end in the gated residual's write --
|
||||
// the MoE gather in front of the message and the hc write behind the reduction -- shared by the
|
||||
// exact kernels (r4d_ar_oneshot_2rank_exact.hip) and the rotated 6-bit ones
|
||||
// (r4d_ar_oneshot_2rank_wht6.hip). One copy of it is what makes the two wires' fused forms produce
|
||||
// the bytes of the same unfused chain: moe_gather, the all-reduce, hc_write.
|
||||
// r4d_ar_hc.h: per-word arithmetic of the all-reduces fused with the gated residual write: the MoE
|
||||
// gather before the message and the hc write after the reduction. Shared by the exact kernels
|
||||
// (r4d_ar_oneshot_2rank_exact.hip) and the rotated 6-bit ones (r4d_ar_oneshot_2rank_wht6.hip), so
|
||||
// both fused forms produce the same bytes as the unfused chain moe_gather, all-reduce, hc_write.
|
||||
//
|
||||
// A WORD is eight consecutive bf16 elements of one row -- a row is `n` elements and n is a multiple
|
||||
// A word is eight consecutive bf16 elements of one row. A row is `n` elements and n is a multiple
|
||||
// of eight, so a word never straddles a row.
|
||||
#include <hip/hip_runtime.h>
|
||||
#include "r4d_gdn_wmma.h" // f2bf / bf2f: the gated residual's own bf16 arithmetic
|
||||
|
||||
// The LDS slot table's bounds: the rows one block of the table form covers, and the slots a row
|
||||
// holds.
|
||||
// LDS slot table bounds: rows per block, and slots per row.
|
||||
#define R4D_ARG_ROWS 8
|
||||
#define R4D_ARG_SLOTS 64
|
||||
|
||||
@@ -30,13 +28,13 @@ struct R4dArGather {
|
||||
int top_k, T, sig;
|
||||
};
|
||||
|
||||
// ONE WORD OF THE GATHER: y[row][i0 .. i0+8) = sum over the row's slots, ascending, of
|
||||
// w[row][j] * y_expert[slot][i0 ..], rounded to bf16, with the shared arm folded as moe_gather
|
||||
// folds it -- its narrows are round-to-nearest-even, not hc_write's.
|
||||
// One word of the gather: y[row][i0 .. i0+8) = sum over the row's slots, ascending, of
|
||||
// w[row][j] * y_expert[slot][i0 ..], rounded to bf16, with the shared arm folded in as moe_gather
|
||||
// does it. Its narrows are round-to-nearest-even, unlike hc_write's.
|
||||
//
|
||||
// With INV the slots come from the inverse table inv[token * top_k + slot] (the sorted row holding
|
||||
// it, or -1) and the weights and the gate from global memory; without it from the block's LDS
|
||||
// table, `r` being the row's index in it.
|
||||
// With INV, slots come from the inverse table inv[token * top_k + slot] (the sorted row holding
|
||||
// it, or -1) and weights and gate from global memory. Without it they come from the block's LDS
|
||||
// table, where `r` is the row's index.
|
||||
template <bool INV>
|
||||
__device__ __forceinline__ int4 r4d_ar_gather_word(const R4dArGather& G,
|
||||
const int* __restrict__ inv, const int* s_i,
|
||||
@@ -46,10 +44,9 @@ __device__ __forceinline__ int4 r4d_ar_gather_word(const R4dArGather& G,
|
||||
float acc[8];
|
||||
#pragma unroll
|
||||
for (int e = 0; e < 8; ++e) acc[e] = 0.0f;
|
||||
/* FOUR SLOTS' ROWS IN FLIGHT AT ONCE. Loaded one at a time behind the test for an empty slot,
|
||||
* each row's read waits for the one before it; so the four are issued first -- an empty slot
|
||||
* reads row 0, which is always there -- and then added in the same ascending order, the empty
|
||||
* ones skipped. */
|
||||
/* Four slot rows in flight at once: all four loads issue before any add, so they do not
|
||||
* serialise behind the empty-slot test. An empty slot reads row 0, which always exists, and is
|
||||
* skipped in the ascending add. */
|
||||
constexpr int kU = 4;
|
||||
for (int j0 = 0; j0 < K; j0 += kU) {
|
||||
int4 v[kU];
|
||||
@@ -92,9 +89,9 @@ __device__ __forceinline__ int4 r4d_ar_gather_word(const R4dArGather& G,
|
||||
return out;
|
||||
}
|
||||
|
||||
// ONE WORD OF THE WRITE: h[row][c*n + i0 ..] += inj[row][c] * y[row][i0 ..] for every stream c, in
|
||||
// hc_write's arithmetic (r4d_hc_bf16.hip) over `yv`, the reduced word as the bf16 the reduction
|
||||
// stored -- which is what hc_write reads back from memory.
|
||||
// One word of the write: h[row][c*n + i0 ..] += inj[row][c] * y[row][i0 ..] for every stream c, in
|
||||
// hc_write's arithmetic (r4d_hc_bf16.hip). `yv` is the reduced word as stored bf16, which is what
|
||||
// hc_write reads back from memory.
|
||||
__device__ __forceinline__ void r4d_ar_hc_write_word(const unsigned short* __restrict__ inj,
|
||||
unsigned short* __restrict__ h, int row,
|
||||
int i0, int n, int hc, long irow, long hrow,
|
||||
|
||||
Reference in new issue
Block a user