[GH-ISSUE #1209] 首页的 R1 Q4 性能数字,无法解释 R1 的理论 TPS 上界 #830

Closed
opened 2026-10-29 14:45:05 +00:00 by bsakaguchi · 2 comments
Owner

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。

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。
Author
Owner

@qiyuxinlin commented on GitHub (Apr 28, 2025):

ktrans 的设计是 attention 在 GPU MOE 在 CPU,实际上走 PCIE 的数据量为 attention 到 MOE 之间的激活数据,其次访问的 MOE 参数存储在 CPU 上,这部分受内存带宽影响而不是 PCIE 带宽

<!-- gh-comment-id:2834158932 --> @qiyuxinlin commented on GitHub (Apr 28, 2025): ktrans 的设计是 attention 在 GPU MOE 在 CPU,实际上走 PCIE 的数据量为 attention 到 MOE 之间的激活数据,其次访问的 MOE 参数存储在 CPU 上,这部分受内存带宽影响而不是 PCIE 带宽
Author
Owner

@ghostplant commented on GitHub (Apr 28, 2025):

@qiyuxinlin 哦,不是 MoE “被激活的Top8参数”传入GPU去计算,明白了,那么这个方案和GPU关系不太大了,主要的bottleneck是在借助高配 CPU + DRAM,实现的一个 CPU backend 为主的执行方案,感谢。

<!-- gh-comment-id:2834385178 --> @ghostplant commented on GitHub (Apr 28, 2025): @qiyuxinlin 哦,不是 MoE “被激活的Top8参数”传入GPU去计算,明白了,那么这个方案和GPU关系不太大了,主要的bottleneck是在借助高配 CPU + DRAM,实现的一个 CPU backend 为主的执行方案,感谢。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#830
No description provided.