libr4d: swiglu_step, router_sigmoid_group_topk, mla_attn_paged, and mla_project at head_dim 128

mla_attn_paged is the wave-per-(row, head) latent attention of mla_attn with the rotary part in
the score, one page table a sequence, the causal bound from cu_seqlens and seqused, and the head
gate in its store; a short batch splits the history and merges f32 partials as mla_attn does.
router_sigmoid_group_topk is router_sigmoid_topk's wave with the groups ranked first, a lane a
group. mla_project takes the head width as a template parameter; at 256 it is the kernel it was.
r4d_selftest holds each new row and the 128-wide mla_project to libref.
This commit is contained in:
keptn42 authored and StillDeadcode committed 2026-11-03 19:07:34 +01:00
1 parent e4ca20ddf8
commit 523349dd8f
7 files changed
+619 -29

No files matched your search

+5
View File
@@ -812,6 +812,7 @@ int r4d_rad_logit_softcap (const RadArgs*, RadStream);
int r4d_rad_scale (const RadArgs*, RadStream);
int r4d_rad_silu_mul (const RadArgs*, RadStream);
int r4d_rad_swiglu_clamped(const RadArgs*, RadStream);
int r4d_rad_swiglu_step(const RadArgs*, RadStream);
int r4d_rad_swiglu_clamped_quant_fp8(const RadArgs*, RadStream);
int r4d_rad_dsa_pool(const RadArgs*, RadStream);
int r4d_shape_dsa_pool(const RadParam*, int, int, RadOpdDesc*);
@@ -828,12 +829,16 @@ int r4d_shape_mla_project(const RadParam*, int, int, RadOpdDesc*);
int r4d_rad_dsa_score(const RadArgs*, RadStream);
int r4d_shape_dsa_score(const RadParam*, int, int, RadOpdDesc*);
int r4d_rad_mla_attn(const RadArgs*, RadStream);
int r4d_rad_mla_attn_paged(const RadArgs*, RadStream);
int r4d_shape_mla_attn_paged(const RadParam*, int, int, RadOpdDesc*);
int64_t r4d_rad_mla_attn_scratch(const RadArgs*);
int r4d_rad_mla_attn_matrix(const RadArgs*, RadStream);
int64_t r4d_rad_mla_attn_matrix_scratch(const RadArgs*);
int r4d_rad_mla_attn_rows(const RadArgs*, RadStream);
int r4d_shape_mla_attn(const RadParam*, int, int, RadOpdDesc*);
int r4d_rad_router_sigmoid_topk(const RadArgs*, RadStream);
int r4d_rad_router_sigmoid_group_topk(const RadArgs*, RadStream);
int r4d_shape_router_sigmoid_group_topk(const RadParam*, int, int, RadOpdDesc*);
int r4d_shape_router_sigmoid_topk(const RadParam*, int, int, RadOpdDesc*);
int r4d_rad_router_sigmoid_topk_scatter(const RadArgs*, RadStream);
int r4d_rad_moe_scatter_inv(const RadArgs*, RadStream);