mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #39] [Performance] transfer_engine_bench get poor throughput with RDMA protocol #24
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#24
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 @woodyji on GitHub (Dec 16, 2024).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/39
First of all, thank you for open-sourcing TransferEngine. However, I encountered some performance issues during my testing:
Performance Discrepancies
Issue 1: Single NIC Performance
transfer_engine_benchachieved only 6.56 GB/s.ib_send_bw(RDMA perftest tool): 11.47 GB/s.Commands Used:
target:
initiator:
ib_send_bw server:
ib_send_bw client:
Issue 2: Multi NIC Performance
transfer_engine_benchachieved only 1.57GB/s.ib_send_bw(RDMA perftest tool): 11.47 GB/s.Commands Used:
target:
initiator:
ib_send_bw server:
ib_send_bw client:
Questions
@alogfans commented on GitHub (Dec 16, 2024):
By default,
transfer_engine_benchrepeatedly performs reads/writes with--threads=4threads. For each iteration, it submits--batch_size=128work requests, each of them transfers--block_size=4096bytes data. You can try to tune these parameters to see performance improvement (increase--block_sizeand--threads=4, reduce--batch_size=128, ...)Your execution produces poor performance because both instances are binded with the same processor. You can set
--device_name=mlx5_0,mlx5_1(do not add space and comma) to test multi NIC using one target/initiator process.@woodyji commented on GitHub (Dec 16, 2024):
Yes, I have experimented parameters like these, but the performance remains at the same level. Do you have any best practices to share?
The transfer_engine_bench achieved better throughput which changed from 1.57GB/s to 2.37GB/s, but it is still not satisfactory. Besides, your vllm integration use one target/initiator process per rank, might have the same issue?
@alogfans commented on GitHub (Dec 16, 2024):
We have tested the latest code in our environment.
ib_write_bwis 13.01 GB/s.Does your machine share with other users, especially they consume CPU resources?
@woodyji commented on GitHub (Dec 18, 2024):
The performance issue can be resolved by adding
IBV_ACCESS_RELAXED_ORDERINGto the memory region access flags. However, I'm curious as to why this flag was not set initially.@alogfans commented on GitHub (Dec 19, 2024):
Thanks for your report. I am preparing a PR to enable this flag if user requested.
@woodyji commented on GitHub (Dec 20, 2024):
I notice that
transfer_engine_benchuseblock_sizeasTransferRequest's length, dose it meansPagedAttention'sblock_size?In practice, is every block must be registered once? If that's the case, it could lead to a significant number of registered memory regions. Are there any potential performance implications associated with this? Additionally, when is a block unregistered? Is it after the request is processed or only once the inference server is destroyed?
@alogfans commented on GitHub (Dec 20, 2024):
block_sizejust represent how many bytes to be transferred per request in benchmark programtransfer_engine_bench. It is not related toPagedAttention.A block can be transferred for multiple times, if the previous one is completed.
@woodyji commented on GitHub (Dec 20, 2024):
This means every
PagedAttention's block registered once? As I mentioned earlier, this could lead to a significant number of registered memory regions? I'm considering how the TransferEngine integrates with thePagedAttention's block.@alogfans commented on GitHub (Dec 23, 2024):
If these
PageAttention's blocks are stored contiguously, they can be registered as one memory region. You may consider change the allocation ofPageAttention's blocks.@woodyji commented on GitHub (Dec 27, 2024):
Thank you, the issue can now be closed.