Archived
libr4d: fp8_v4 and k6_v4 caches -- stores, folded prologues, h256/gqa6 attention
Two narrower layouts of an attention cache, a head's dims in groups of 32 with an f16 scale: fp8_v4 (E4M3 K, int4 V; 25 * head_dim / 16 bytes a token and head) and k6_v4 (int6 K, int4 V; 22 / 16). kv_store and qk_norm_rope_gate_kv_store write them (the folds byte-identical to the pairs); attn_prefill / attn_decode at h256 gqa6 widen the codes to f16 in a tile's staging, V a key pair's 8 dims a thread fetched a tile ahead and widened with packed f16 (one rounding, a dword store holding both keys), K6's high bits laid out so one mask and shift join them to the low nibbles. r4d_selftest: the stores against an exactly representable set, the folds, and the attention rows against the inline oracle extended to the layouts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a14fab2317
commit
c00a650bce
10 files changed
+781
-45
No files matched your search
@@ -91,6 +91,12 @@ extern "C" {
|
||||
int r4d_rad_attn_prefill_h256_fp8 (const RadArgs*, RadStream);
|
||||
int r4d_rad_attn_prefill_h256_bf16(const RadArgs*, RadStream);
|
||||
int r4d_rad_attn_decode_h256_fp8 (const RadArgs*, RadStream);
|
||||
int r4d_rad_attn_decode_h256_fp8v4(const RadArgs*, RadStream);
|
||||
int r4d_rad_attn_prefill_h256_fp8v4(const RadArgs*, RadStream);
|
||||
int64_t r4d_rad_attn_decode_h256_v4_scratch(const RadArgs*);
|
||||
int r4d_rad_attn_decode_h256_k6v4(const RadArgs*, RadStream);
|
||||
int r4d_rad_attn_prefill_h256_k6v4(const RadArgs*, RadStream);
|
||||
int64_t r4d_rad_attn_decode_h256_k6_scratch(const RadArgs*);
|
||||
int r4d_rad_attn_decode_h256_bf16 (const RadArgs*, RadStream);
|
||||
int r4d_rad_attn_decode_h128_fp8 (const RadArgs*, RadStream);
|
||||
int r4d_rad_attn_decode_h128_bf16 (const RadArgs*, RadStream);
|
||||
@@ -410,6 +416,8 @@ int r4d_rad_gated_had_quant_i8 (const RadArgs*, RadStream);
|
||||
int r4d_rad_gdn_gated_norm_hq_i8 (const RadArgs*, RadStream);
|
||||
int r4d_rad_qk_norm_rope_gate (const RadArgs*, RadStream);
|
||||
int r4d_rad_qk_norm_rope_gate_kv_store(const RadArgs*, RadStream);
|
||||
int r4d_rad_qk_norm_rope_gate_kv_store_fp8v4(const RadArgs*, RadStream);
|
||||
int r4d_rad_qk_norm_rope_gate_kv_store_k6v4(const RadArgs*, RadStream);
|
||||
int r4d_rad_rope_table (const RadArgs*, RadStream);
|
||||
|
||||
/* -- block-scaled fp8, and the device sampler (r4d_gemm_fp8*.hip / r4d_fp8_layout.cpp) --
|
||||
@@ -607,6 +615,8 @@ int r4d_rad_gemm_nt_bias (const RadArgs*, RadStream);
|
||||
int r4d_rad_gemm_f32_nt_bias(const RadArgs*, RadStream);
|
||||
int r4d_rad_kv_store (const RadArgs*, RadStream);
|
||||
int r4d_rad_kv_store_fp8 (const RadArgs*, RadStream);
|
||||
int r4d_rad_kv_store_fp8v4 (const RadArgs*, RadStream);
|
||||
int r4d_rad_kv_store_k6v4 (const RadArgs*, RadStream);
|
||||
int r4d_rad_logits_gemm (const RadArgs*, RadStream);
|
||||
|
||||
/* -- the decomposed sampler chain (r4d_sample_stages_f32.hip) --
|
||||
|
||||
Reference in new issue
Block a user