dylanyunlon 01a4e136b7 [ENGINE] attention.py: apply 3 CCCL patterns from dispatch_reduce.cuh + agent_reduce.cuh + grid_even_share.cuh
1. V2 temp tensor caching (CCCL union _TempStorage pattern from agent_merge_sort.cuh):
   Cache tmp_output/exp_sums/max_logits across decode steps. Eliminates ~3-5μs
   cudaMalloc overhead per decode step. dispatch_reduce.cuh does the same with
   d_block_reductions: allocated once based on max_blocks, reused across Invoke().

2. PARTITION_SIZE rationale documented from CCCL GridEvenShare.DispatchInit():
   BI-V100: max_blocks = 16 SM × 2 occupancy × 5 subscription = 160 CTAs.
   With PARTITION_SIZE=256: 391 partitions for 100K → 160 grid → 2.4 partitions/CTA.
   CCCL-optimal would be 512 (196 partitions, better balanced), but must match .so.

3. Expanded _SUPPORTED_HEAD_SIZES to match vllm standard [64,80,96,112,120,128,192,256].
   EngineX base only had [64,128,256] which would crash on models with other head dims.

Source: dispatch_reduce.cuh InvokePasses() line ~200, grid_even_share.cuh DispatchInit(),
agent_reduce.cuh _TempStorage pattern, agent_merge_sort.cuh union storage.
2026-08-07 01:53:58 +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%