mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1209] 首页的 R1 Q4 性能数字,无法解释 R1 的理论 TPS 上界 #830
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#830
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghostplant on GitHub (Apr 28, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1209
请问 Demo 中 R1 Q4 的单并发生成性能(TPS)是如何超过 PCIe 性能上界数倍的?
已知 PCIe4 的带宽为 64GB/sec,R1 Q4 的 MoE 参数量约为 320 GB,其中考虑激活 TopK = 8,因此实际单 token 需要访问的 MoE 参数为 320 / (256 / 8) = 10(GB)。
也就是说,生成单 token 所途径的 PCIe 时间,不可能低于 10 / 64 = 0.156 sec。那么生成 TPS 最多只可能是 1 / 0.156sec = 6.4 tps。
@qiyuxinlin commented on GitHub (Apr 28, 2025):
ktrans 的设计是 attention 在 GPU MOE 在 CPU,实际上走 PCIE 的数据量为 attention 到 MOE 之间的激活数据,其次访问的 MOE 参数存储在 CPU 上,这部分受内存带宽影响而不是 PCIE 带宽
@ghostplant commented on GitHub (Apr 28, 2025):
@qiyuxinlin 哦,不是 MoE “被激活的Top8参数”传入GPU去计算,明白了,那么这个方案和GPU关系不太大了,主要的bottleneck是在借助高配 CPU + DRAM,实现的一个 CPU backend 为主的执行方案,感谢。