Implement exact DSpark attention and Markov ops

Shared-anchor window attention and full-vocabulary greedy Markov as named
ops, with libref oracles. Register the anchor-window kernel constraints.
This commit is contained in:
Constantin committed 2026-11-03 13:56:45 -05:00
1 parent b43088a334
commit 340ff8781a
13 files changed
+723 -19

No files matched your search

+11
View File
@@ -188,6 +188,16 @@ int r4d_rad_attn_window_h512_gqa8_fp8 (const RadArgs*, RadStream);
int64_t r4d_rad_attn_window_h128_scratch(const RadArgs*);
int64_t r4d_rad_attn_window_h256_scratch(const RadArgs*);
int64_t r4d_rad_attn_window_h512_scratch(const RadArgs*);
#define R4D_ATTN_ANCHOR_DECL(HD, G) \
int r4d_rad_attn_anchor_window_h##HD##_gqa##G##_bf16kv(const RadArgs*, RadStream); \
int r4d_rad_attn_anchor_window_h##HD##_gqa##G##_fp8kv(const RadArgs*, RadStream);
R4D_ATTN_ANCHOR_DECL(128, 1)
R4D_ATTN_ANCHOR_DECL(256, 1) R4D_ATTN_ANCHOR_DECL(256, 2) R4D_ATTN_ANCHOR_DECL(256, 4)
R4D_ATTN_ANCHOR_DECL(256, 8)
R4D_ATTN_ANCHOR_DECL(512, 1) R4D_ATTN_ANCHOR_DECL(512, 2) R4D_ATTN_ANCHOR_DECL(512, 4)
R4D_ATTN_ANCHOR_DECL(512, 8)
#undef R4D_ATTN_ANCHOR_DECL
int r4d_rad_dflash_markov_greedy(const RadArgs*, RadStream);
/* attn_paged_qrow_tree (docs/OPS.md): the h256/gqa2 split-KV decode and the windowed kernels with a
* tree verify's mask from operand 8, `spec_parent`. */
int r4d_rad_attn_qrow_tree_decode_h256_gqa2_fp8 (const RadArgs*, RadStream);
@@ -1001,6 +1011,7 @@ int r4d_shape_qsa_work (const RadParam*, int, int operand, RadOpdDesc*
int r4d_shape_dflash_conv (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_dflash_select (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_dflash_markov (const RadParam*, int, int operand, RadOpdDesc*);
/* -- declared fusions (r4d_fuse.cpp, pure host) --
*