| Prefill SimpleGLA chunk kernel | 低优先级。chunk_simple_gla 已是主路径,文档记录 65% occupancy,chunk-size/API 替换已失败 | 0-1% wall,除非同时改 q/k/v layout | 高。GLA recurrence/reduction 顺序极敏感,chunk_size=128 已 max_diff=0.25 | 中。Triton 能写,但 sm_120 无 TMEM/FA4,TMA 对 paged/strided GLA收益有限 | 1-2 周 | 对拍 chunk_simple_gla:全 chunk、tail、mixed batch、长上下文;再跑 bench/kernels/prefill/prefill_bench_smax64.py |
| Decode direct-state kernel | 已基本落地:BK64/BK64_2K direct-state 避开 state[indices].contiguous() 和 scatter | 新增空间约 0-1%;历史 B32 负向多,S8 接近噪声 | 中。BK128 更快但改 reduction order,不 bit-exact;8/16 warps 已证伪 | 低-中。Triton sm_120 可用,但寄存器/occupancy 很容易反向 | 2-5 天做小变体,不建议大改 | 复用 bench/kernels/minicpm/bench_simple_gla_direct_decode.py,必须比对 output/state bitwise,再跑 s8_stable_decode/b32_drain_decode |
| Target_verify fused recurrent | 最高可继续挖。当前 _fused_recurrent_gla_intermediate_kernel 已融合 steps 并写 intermediate_ssm | 小到中:单 kernel micro 可能 5-15%,e2e 预计 <1-2% | 中。tree parent、rollback、intermediate state 每步必须完全一致 | 中。Triton loop + [BK,BV] fp32 state 寄存器压力高,sm_120 可能 spill | 3-7 天 | tests/test_simple_gla_tree_verify.py、tests/test_fused_gla_cuda_graph.py,再固定 badcase 对比 no-spec/spec 答案 |
o_buf.sum(0).to(bf16) 融合进 recurrent | 不建议作为主线。历史记录 strided graph path 下 microbench 0.94x,B36 有收益但非主 gate | 0 或负;最多小 batch 特例 | 中。sum/cast 顺序一改就可能非 bit-exact | 低 | 1-2 天复核 | 只接受 graph-path strided slice 正收益;离线 bitwise + S8 quick bench |
| qkv/qk_norm/rope 周边 fusion | 已有 OOP Triton 路径,文档说默认开启,收益约 -0.8% wall;继续空间有限 | 0-0.5%,主要是更少 launch/contiguous | 中低。当前 OOP 对 q/k 有 1-2 ULP,不是 bitwise;若“等价”要求 bitwise,则只能守旧路径 | 低。Triton OOP 比 TRT-LLM in-place 更适合 sm_120 | 2-4 天 | 对拍 q/k/v ULP、全模型 smoke、prefill line39;注意不要破坏 CUDA graph capture |
| o_norm/sigmoid/mul/o_proj 周边 fusion | o_norm+sigmoid+mul 已有 3-in-1 Triton;o_proj 是 FP4 GEMM,真正融合到 GEMM epilogue会变成非 bitwise | 现有约 -1ms/chunk;新增 o_proj fusion training-free exact 价值低 | 高。GEMM epilogue direct FP4 会改变舍入,文档已明确不追求 bitwise | 高。SM120 gated blockscale epilogue需要 CUTLASS/FlashInfer 级改造,JIT/AOT 都麻烦 | 1-3 周 | 若坚持 exact:只做周边 pointwise bitwise/ULP 对拍。若做 epilogue:必须公开集 accuracy,不算“等价” |
| State layout / precision | layout 可做,precision 不建议。GLA temporal state 当前 fp32,历史已判 mamba cache INT8/4 不可行 | layout 0.5-2%;precision 降低不应做 | layout 中;precision 高,会累积误差 | 中。state 是 [pool,H,K,V] 大 fp32,改 layout会影响 decode、verify、rollback、CUDA graph buffer | 1 周起 | state read/write bitwise、rollback badcase、longctx_s8、mixed stop/drain;precision 需公开集和长上下文一致性 |