Archived
radiance 1.14.0
New models and formats: - libr3d: a kernel library for RDNA3 (gfx11) cards - nomic-embed-text-v2-moe (the nomicbert plugin) - Gemma 4 E2B with its per-layer MLP width, and Google's unmodified E2B/E4B directories in bf16 - DeepSeek-V4.1-Flash converted straight from its release: the Engram tables, the fused imatrix and rad-convert --chat-template for a release that ships no template - GGUF Q8_0, Q4_K and Q6_K tensors import as their planes; rad-convert writes them without a recipe - Qwen3.8-Flash-Next-FP8 converts and serves through qwen4exp_fp8 Speed: - hc_read's decode kernels as one grid (34.7 -> 25.2 us at 4 rows) and its tiled up-mix pipelined - gemm_fp8a8: the narrow form's scales staged through LDS (Flash-Next int8 at 32 rows 83.6 -> 68.3 us), the gated three-tile form at 8 waves (gate_up at 48 rows 272.9 -> 180.6 us) - Qwen3.8-27B: the delta net's out-projection read beside its decode recurrent update (x1 19.40 -> 19.10 ms a step), and the verify's split-KV attention sized by context depth (x3 at 180K 42.4 -> 40.3 ms a step) - Hy-Memory (HYV3) decode: fused QK norm, RoPE and KV store, residual adds folded into the norms, coalesced one-token expert GEMMs - spechub: the coupled verify walks the live candidates only (151 -> 31 us a launch) Speculation: - DFlash2: lossless coupled acceptance at T > 0 (--draft-coupling on) - A block drafter's proposals verified as a tree, on by default for the Gemma 4 31B's DFlash2, with a block-16 tree that runs its short block under load Features: - Decode-hot residency: --draft-expert-placement host, --expert-profile, --expert-pin-top, and --expert-stats FILE for the routed experts each layer selects - --ngram-placement ram=DIR: one n-gram table shared by engines on separate cards - Prefix cache: --prefix-resume exact (default) resumes a hit on the cold run's own chunk grid, so it answers bit-identically; snapshots at a head other prompts share, from 528-token prompts, and for tip-only one drafter window below the tip; hits on models whose KV groups have different block sizes; the snapshot store keeps a floor of 8 ahead of --host-headroom-mib - Typed tool-call argument tags; rad-chatparse --request renders and reads back one request as the server does - MiniMax-H3: keyframes ride a latent upscale - Gemma 3's fused all-reduce junction on the lossy wire Fixes: - A speculative step shorter than its band (an MTP step of 4 rows at gqa 8) no longer stops the engine with a scratch refusal at issue (#293) - --p2p off: prefill back to 1.12.0's rate; 1.13.0's push check read a host-memory slot over the link twice (#323) - A chat template that cannot render a conversation is refused at load, not mid-request - imatrix entries found under llama.cpp's spelling; the W4A8 prefill's tail scale read; the GDN conv kernels on an f32 weight; dense integer rows at the group they compute (a Q8_0 weight at group 32) - --expert-profile refuses a profile recorded on another model - hc_read's one-grid wait traps past its deadline instead of reading a stale value Changes: Plugin ABI 31, unchanged. RADIANCE_DRAFT_TREE, DFLASH2_TREE_NODES, DFLASH2_TREE_TEMP and DFLASH_Q_TEMP are gone (trees run where the probe says they pay; temperatures 1.25 / 0.6).
This commit is contained in:
1 parent
481fcd5df0
commit
4a61d7296b
160 files changed
+8790
-6819
No files matched your search
+35
-45
@@ -1,14 +1,12 @@
|
||||
# libr3d serves RDNA3 only, declared here and nowhere else. Its kernels rely on wave32 and on
|
||||
# instructions RDNA3 has: v_dot2acc_f32_f16 for the matrix work, v_cvt_pkrtz_f16_f32, DPP16 and
|
||||
# v_permlanex16. They do not use the WMMA fragment layouts (RDNA3's 16x16x16 wave-matrix family is
|
||||
# a re-tile of the dot2 lane map, not a drop-in) or gfx12-only instructions such as
|
||||
# global_load_tr_b128, and they decode every quantised weight in software: the lane map, not a
|
||||
# missing instruction, is the reason.
|
||||
# libr3d serves RDNA3 only; this file is the one place that says so. Its kernels rely on wave32 and
|
||||
# on RDNA3 instructions: v_dot2acc_f32_f16 for the matrix work, v_cvt_pkrtz_f16_f32, DPP16 and
|
||||
# v_permlanex16. They do not use the WMMA fragment layouts (RDNA3's 16x16x16 wave-matrix family
|
||||
# needs a different lane map than dot2) or gfx12-only instructions such as global_load_tr_b128,
|
||||
# and they decode every quantised weight in software because of that lane map.
|
||||
#
|
||||
# A build targeting other cards skips libr3d. The engine then has no device kernel library for that
|
||||
# card and refuses ops only a reference library implements, unless
|
||||
# --debug-accept-reference-kernels is passed (spec §17). The supported fix is a kernel library for
|
||||
# that card; libr4d is that library for gfx12 and libr3d is it for gfx11.
|
||||
# A build targeting other cards skips libr3d. Without a device kernel library the engine refuses ops
|
||||
# only a reference library implements, unless --debug-accept-reference-kernels is passed (spec §17).
|
||||
# libr4d is the kernel library for gfx12, libr3d for gfx11.
|
||||
#
|
||||
# Built in radiance's tree, or standalone against an installed radiance
|
||||
# (`cmake -S libr3d -B build -DCMAKE_PREFIX_PATH=<radiance prefix>`, naming the HIP compiler as for
|
||||
@@ -20,11 +18,11 @@ if(NOT COMMAND rad_add_plugin)
|
||||
rad_plugin_defaults()
|
||||
endif()
|
||||
|
||||
# `^gfx11` is the family, not a chip: gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151 and the
|
||||
# family target `gfx11-generic` all take these kernels, exactly as `^gfx12` covers RDNA4 for libr4d.
|
||||
# The RDNA3 cards differ in CU count and clock, never in the instructions these kernels issue, so
|
||||
# one code object per family serves the lot; a build that lists both a chip and the family gets
|
||||
# both, and the engine picks the chip's object first (docs/PLUGIN.md §10).
|
||||
# `^gfx11` matches the family: gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151 and
|
||||
# `gfx11-generic`, as `^gfx12` does for libr4d. The RDNA3 chips differ in CU count and clock, not in
|
||||
# the instructions these kernels issue, so one code object per family serves them all. A build
|
||||
# listing both a chip and the family gets both, and the engine prefers the chip's object
|
||||
# (docs/PLUGIN.md §10).
|
||||
rad_plugin_gpu_targets(R3D_GPU_TARGETS "^gfx11")
|
||||
if(NOT R3D_GPU_TARGETS)
|
||||
message(STATUS
|
||||
@@ -32,16 +30,15 @@ if(NOT R3D_GPU_TARGETS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# R3D_UNITS is the definitive list of libr3d's device translation units, as "unit|extra flags".
|
||||
# R3D_UNITS lists libr3d's device translation units, as "unit|extra flags".
|
||||
#
|
||||
# Every unit is compiled -ffp-contract=off, which rad_hipify puts on all HIP sources. It is not a
|
||||
# style preference: libref accumulates in f32 with no FMA and no reassociation (ref_common.h), and
|
||||
# a contracted device kernel disagrees with the oracle it is checked against. It also keeps the
|
||||
# instruction counts quoted in kernel comments true.
|
||||
# Every unit is compiled -ffp-contract=off (rad_hipify sets it on all HIP sources). libref
|
||||
# accumulates in f32 with no FMA and no reassociation (ref_common.h), and a contracted kernel would
|
||||
# disagree with that oracle. It also keeps the instruction counts quoted in kernel comments true.
|
||||
|
||||
# Kernels and libr3d's declaration (row table, operand descriptions) share one directory. There is
|
||||
# no launch adapter: every entry point takes `(const RadArgs*, RadStream)` and sits beside its
|
||||
# kernel. The plugin links rad_abi only, like one written out of tree.
|
||||
# Kernels and the declaration (row table, operand descriptions) share one directory. Every entry
|
||||
# point takes `(const RadArgs*, RadStream)` and sits beside its kernel. The plugin links rad_abi
|
||||
# only, like an out-of-tree plugin.
|
||||
|
||||
set(R3D_UNITS
|
||||
# The model's small ops, one workgroup per row: rmsnorm, layernorm, the binary and unary element
|
||||
@@ -49,19 +46,19 @@ set(R3D_UNITS
|
||||
# kv_store. This is the set the engine refuses on a card with no device kernel library.
|
||||
"r3d_model_bf16|"
|
||||
# The sampler's pre-filters: penalties, DRY, the n-gram ban, the bitmask, and the logprobs
|
||||
# summary, which reads the logits plane once where the reference reads it three.
|
||||
# summary, which reads the logits plane once (the reference reads it three times).
|
||||
"r3d_sample_pre_f32|"
|
||||
# The speculative decoder's accept step: a walk over the draft block's candidate lattice, which is
|
||||
# a gather out of two codebooks rather than arithmetic.
|
||||
"r3d_dflash_f32|"
|
||||
# The gated MLP band: GEMM, gate and output quantiser in one launch, so the [M,N] intermediate the
|
||||
# unfused chain writes and re-reads never exists.
|
||||
# The gated MLP band: GEMM, gate and output quantiser in one launch, so the [M,N] intermediate
|
||||
# is never written to memory.
|
||||
"r3d_gemm_fp8a8_gated|"
|
||||
# The vocab projection at decode: U2 codes, int8 activations, a joined scale+zero operand.
|
||||
"r3d_gemm_nt_q_w2a8|"
|
||||
# The vocabulary projection at both heights: the head streamed for M <= 16, tiled above it.
|
||||
"r3d_vocab_bf16|"
|
||||
# The quantised GEMM at prefill heights: the 176 bands a forward pass ran on the CPU.
|
||||
# The quantised GEMM at prefill heights.
|
||||
"r3d_gemm_fp8a8_tiled|"
|
||||
# The OCP-MXFP4 weight against the fp8 activation, both heights: e2m1 codes with one e8m0 scale
|
||||
# per 32 of K, the block's partials scaled at the block boundary.
|
||||
@@ -77,18 +74,14 @@ set(R3D_UNITS
|
||||
# Activation quantisation: per-(row, group) symmetric E4M3 and int8, the gated form that
|
||||
# quantises a silu-gated pair, and the dequantise that reads a container's own quantised weights.
|
||||
"r3d_quant_fp8|"
|
||||
# The skinny bf16 GEMM, M <= 16: one output element a lane, k ascending, so the accumulation order
|
||||
# is libref's. The decode GEMM -- the op a token is made of.
|
||||
# The skinny bf16 GEMM for decode, M <= 16: one output element a lane, k ascending, so the
|
||||
# accumulation order is libref's.
|
||||
"r3d_gemm_bf16_nt_m16|"
|
||||
# The same shape over a block-scaled fp8 weight, decoded to f16 exactly (E4M3's four exponent bits
|
||||
# and three mantissa bits are a subset of f16's), and over int8 codes.
|
||||
"r3d_gemm_fp8a16_nt_m1|"
|
||||
# Landing next, in the same shape as libr4d's: the prefill GEMM (an 8x8 tile a wave over LDS, the
|
||||
# same dot2 inner product), paged causal attention (the decode leg split-KV, the prefill leg a
|
||||
# query tile a workgroup, bf16 or fp8 KV), the vocab (logits as a GEMM over the embedding, the row
|
||||
# top-k, the cross-rank top-1) and the sampler's stages. Their rows are not in r3d_rows.cpp yet,
|
||||
# because a row naming an entry point that is not in the library is an undefined symbol and the
|
||||
# plugin would fail to load, taking every other row with it.
|
||||
# A row in r3d_rows.cpp must name an entry point defined by one of these units: an undefined
|
||||
# symbol makes the whole plugin fail to load.
|
||||
)
|
||||
|
||||
set(R3D_SRC "")
|
||||
@@ -110,12 +103,11 @@ foreach(u ${R3D_UNITS})
|
||||
list(APPEND R3D_SRC "${src}")
|
||||
endforeach()
|
||||
|
||||
# The host sources are declaration only: the row table, the operand descriptions and the fusion
|
||||
# claims. They are pure host C++ that includes neither r3d.h nor hip_runtime.h, so these tables
|
||||
# compile and can be inspected without ROCm. libr3d has no layout source: nothing it serves is
|
||||
# repacked, because a dot2 GEMM reads a weight in the order it is stored (see r3d_rows.cpp).
|
||||
# r3d_fuse.cpp joins the list with the first fused row: a `replaces` chain with no row naming it
|
||||
# would be dead code, and the fused rmsnorm-then-quant kernel is the first one worth its bytes.
|
||||
# The host sources are declaration only: the row table and the operand descriptions. They are pure
|
||||
# host C++ that includes neither r3d.h nor hip_runtime.h, so the tables compile and can be inspected
|
||||
# without ROCm. libr3d has no layout source: nothing it serves is repacked, because a dot2 GEMM
|
||||
# reads a weight in the order it is stored (see r3d_rows.cpp). There is no fusion source because
|
||||
# no fused row exists.
|
||||
set(R3D_DECLARATION r3d_rows.cpp r3d_shapes.cpp)
|
||||
|
||||
rad_add_plugin(libr3d kernels
|
||||
@@ -137,14 +129,12 @@ add_executable(r3d_selftest ${CMAKE_CURRENT_SOURCE_DIR}/r3d_selftest.cpp)
|
||||
# Links the HIP runtime to allocate the device buffers it feeds the kernels.
|
||||
target_link_libraries(r3d_selftest PRIVATE radiance::abi ${CMAKE_DL_LIBS} ${RAD_HIP_RUNTIME})
|
||||
target_include_directories(r3d_selftest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
# The device phase of the selftest -- the per-row launch -- is built only when the HIP runtime is
|
||||
# there, which in this plugin's build it always is.
|
||||
# The selftest's device phase (the per-row launch) needs the HIP runtime, which this build has.
|
||||
target_compile_definitions(r3d_selftest PRIVATE RAD_HAVE_HIP)
|
||||
set_target_properties(r3d_selftest PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
# Installed beside the tools, so the image can run the rows' own card checks without a build tree:
|
||||
# r3d_selftest <home>/kernels/libr3d.so [--case <row>]
|
||||
install(TARGETS r3d_selftest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
# C++17, the standard every radiance plugin builds device code at: it is what the tree's kernels are
|
||||
# written against and what the cost figures assume.
|
||||
# C++17, the standard all radiance plugins build device code with.
|
||||
set_target_properties(libr3d PROPERTIES HIP_STANDARD 17 HIP_STANDARD_REQUIRED ON)
|
||||
Reference in new issue
Block a user