Archived
- 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
33 lines
1.5 KiB
C++
33 lines
1.5 KiB
C++
// r4d_fp8_lm.h -- stored row geometry of the fp8 lm_head. Pure C++ (no HIP, no r4d.h) so the
|
|
// layout hook (r4d_fp8_layout.cpp), the entry point (r4d_gemm_fp8a16_nt_m1.hip) and the selftest
|
|
// derive the row width from one definition.
|
|
//
|
|
// `logits_gemm` carries one weight operand, so the block scales live in each row's tail (see
|
|
// r4d_rad_layout_fp8_logits); a row-sharded lm_head stays a plain byte range under TP.
|
|
//
|
|
// Padding: both kernels that read this plane (the M <= 2 matvec and the WMMA tile) load the weight
|
|
// as uint4 at `row * w_ld + (a multiple of 16)`, so the row pitch must be a multiple of 16. The
|
|
// unpadded width is one only when
|
|
//
|
|
// K + 2*(K/128) = 130m (K = 128m) is 0 mod 16 <=> m is 0 mod 8 <=> K is 0 mod 1024
|
|
//
|
|
// e.g. K = 5120 qualifies, K = 2560 does not. The pad costs under 16 bytes per row (0.3% at
|
|
// K = 2560) and is a no-op when K is a multiple of 1024, where the plane is byte-identical to the
|
|
// unpadded one.
|
|
//
|
|
// This is a 16-byte correctness floor, unrelated to the 128-byte row padding that
|
|
// r4d_gemm_fp8a16_nt_m1.hip's header evaluates and rejects.
|
|
#pragma once
|
|
#include <cstdint>
|
|
|
|
namespace r4d_fp8 {
|
|
|
|
// Bytes one stored lm_head row occupies: K E4M3 codes, then K/128 bf16 block scales, then the
|
|
// alignment tail. K must be a multiple of 128 (the scale block); the caller checks that.
|
|
inline int64_t lm_row_bytes(int64_t K) {
|
|
const int64_t used = K + 2 * (K / 128);
|
|
return (used + 15) & ~(int64_t)15;
|
|
}
|
|
|
|
} // namespace r4d_fp8
|