ca3697f4b017d031d792fc76b89c77635ffb134d
Eliminates per-decode-step torch.full/torch.zeros GPU allocations that cause OOM after thousands of generation steps (case_truncation max_tokens=8192). Three allocation sites replaced with staging buffer .fill_()/.zero_() reuse: - scores_padded: torch.full([H, padded_len], -inf) → _staging_scores slice - v_padded_kv: torch.zeros([kv_h, padded_len, d]) → _staging_v_kv slice - v_padded: torch.zeros([H, padded_len, d]) → _staging_v slice Pattern from CCCL cub/detail/warpspeed/resource/smem_resource.cuh: SmemResource pre-allocates stageCount buffers, nextStage() cycles through them. PyTorch translation: allocate once at function entry, slice per step.
project_6
Description
Languages
C++
41.8%
Cuda
31.6%
Python
22.2%
C
2.1%
CMake
1.1%
Other
1.1%