project_6 8a87e378f8 [prefill] asymmetric BLOCK_M/BLOCK_N from CCCL AgentReduce insight
CCCL agent_reduce.cuh reveals the key asymmetry in flash attention tiling:
- Q tile stays RESIDENT in registers across the entire K/V loop
- K/V tiles STREAM through: each iteration loads new BLOCK_N, consumes, frees
- Therefore BLOCK_N can differ from BLOCK_M

This is NOT parameter tuning. This is a structural observation from reading
agent_reduce.cuh's ConsumeFullTile: it uses striped loads where the tile
stays resident while data streams through. The same pattern applies to
flash attention's inner loop.

For BI-V100 (SM=16, SMEM=48KB, head_dim=128, fp16):
  BLOCK_M=32, BLOCK_N=128 → Q=8KB resident + K=32KB streaming = 40KB (82%)
  This maximizes K/V bandwidth utilization per iteration.

Also: removed stale import time / timing code from kernel launch.

Source: cccl_upstream/cub/cub/agent/agent_reduce.cuh lines 195-230
        (ConsumeFullTile vectorized vs scalar path)
2026-08-05 03:07:20 +00:00
2026-07-30 17:03:23 +08:00

project_6

Description
No description provided
Readme 427 MiB
Languages
C++ 41.8%
Cuda 31.6%
Python 22.2%
C 2.1%
CMake 1.1%
Other 1.1%