60f0e2a61c81753948bf7ffd198ea5d2b0710eb1
V2 paged_attention_v2_pytorch.py 是纯 PyTorch 实现: - for seq_idx in range(num_seqs) 的 Python 循环 - 每个 sequence ~8 次 tensor ops (gather, permute, bmm, exp, sum, bmm, div) - num_seqs=8 → ~64 kernel launches + Python overhead per decode step V1 ixf_F.vllm_single_query_cached_kv_attention 是单个 fused C++ kernel: - 一次 launch 处理所有 sequences - 天数智芯专门为 BI-V100 优化的 native kernel 之前的 commit 把 use_v1=True 改成了条件判断, 导致 max_seq_len>8192 时 走 V2 PyTorch 路径。竞赛的 100K token 序列正好触发这个条件。 影响: Output TPS 占竞赛权重 83%。每个 decode step 调用一次 forward_decode。 用 64 个 PyTorch ops 替代一个 C++ fused kernel 是必然的性能回退。 修复: use_v1 = True (无条件) V2 代码保留供测试, 但不在生产路径启用。 等有 Triton 或 C++ V2 实现时再启用。 来自 CCCL summary_statistics.cu 的 compound reduce 设计是正确的, 但实现层 (Python) 不对。
project_6
Description
Languages
C++
41.8%
Cuda
31.6%
Python
22.2%
C
2.1%
CMake
1.1%
Other
1.1%