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
+14
-19
@@ -1,30 +1,25 @@
|
||||
// r4d_fwht.h - a wave-local fast Walsh-Hadamard transform, in registers, with no LDS and no barrier.
|
||||
// r4d_fwht.h - a wave-local fast Walsh-Hadamard transform in registers, with no LDS and no barrier.
|
||||
//
|
||||
// WHY IT IS IN REGISTERS. Staging the row in LDS and running the butterfly there costs seven
|
||||
// stages, each a read-modify-write of every element plus a __syncthreads() -- roughly 28 LDS
|
||||
// operations and 7 barriers per element. The transform's own ARITHMETIC is a fraction of a percent
|
||||
// of a rotated quantiser; the LDS traffic and the barriers around it are what a butterfly staged in
|
||||
// LDS actually costs, and they are several times the rest of the kernel. None of that is the
|
||||
// transform, so none of it is paid here.
|
||||
// A butterfly staged in LDS costs seven stages, each a read-modify-write of every element plus a
|
||||
// __syncthreads() (about 28 LDS operations and 7 barriers per element), several times the rest of
|
||||
// a rotated quantiser; the transform's arithmetic is a fraction of a percent.
|
||||
//
|
||||
// THE MAPPING. Give one wave a `HAD`-wide block, VPL = HAD/32 contiguous values per lane, so lane l
|
||||
// holds indices l*VPL .. l*VPL+VPL-1. A butterfly at stride h pairs index i with i+h:
|
||||
// Mapping: one wave holds a `HAD`-wide block, VPL = HAD/32 contiguous values per lane, so lane l
|
||||
// holds indices l*VPL .. l*VPL+VPL-1. A butterfly at stride h pairs index i with i+h:
|
||||
//
|
||||
// h < VPL both indices are in the SAME lane -- plain register arithmetic, no communication
|
||||
// h >= VPL the partner is lane l + h/VPL -- one lane exchange with mask h/VPL
|
||||
// h < VPL both indices in the same lane -- plain register arithmetic
|
||||
// h >= VPL the partner is lane l + h/VPL -- one lane exchange with mask h/VPL
|
||||
//
|
||||
// Since HAD/VPL is always 32, the cross-lane masks are exactly 1, 2, 4, 8, 16 whatever HAD is: five
|
||||
// exchanges per register (r4d_xor_lane, DPP rather than LDS) and no barrier at any width. The lane holding the LOW index of a pair keeps
|
||||
// (v + partner) and the high one keeps (partner - v), which is the same butterfly written twice.
|
||||
//
|
||||
// The caller still needs one barrier before a whole-row reduction, but ONE, not seven.
|
||||
// HAD/VPL is always 32, so the cross-lane masks are 1, 2, 4, 8, 16 at any HAD: five exchanges per
|
||||
// register (r4d_xor_lane, DPP) and no barrier. The lane holding the low index keeps (v + partner),
|
||||
// the high one (partner - v). The caller still needs one barrier before a whole-row reduction.
|
||||
#pragma once
|
||||
#include <hip/hip_runtime.h>
|
||||
#include "r4d_common.h"
|
||||
|
||||
// `hi ? (o - v) : (v + o)` written as `o + (hi ? -v : v)`: the sign flip is one XOR against a mask
|
||||
// that is uniform over the stage, so the per-element select disappears. Bit-identical -- IEEE
|
||||
// negation is exact and addition commutes.
|
||||
// `hi ? (o - v) : (v + o)` written as `o + (hi ? -v : v)`, with the sign flip one XOR against a
|
||||
// stage-uniform mask, so there is no per-element select. Bit-identical: negation is exact and
|
||||
// addition commutes.
|
||||
template <int VPL, int MASK>
|
||||
__device__ __forceinline__ void r4d_fwht_xstage(float* v, int lane) {
|
||||
const unsigned int sm = (lane & MASK) ? 0x80000000u : 0u;
|
||||
|
||||
Reference in new issue
Block a user