Repository navigation
[None][perf] NIXL bounce: push gather into the peer's mapped arena - #22412
Closed
Wanli-Jiang wants to merge 1 commit into
Closed
Wanli-Jiang wants to merge 1 commit into
Wanli-Jiang wants to merge 1 commit into
Conversation
Each agent advertises its bounce arena's CU_MEM_HANDLE_TYPE_FABRIC handle and address range in the bounce handshake (handshake format 2; format 1 blobs still decode, without an export). With agent_bounce_params push_gather (TRTLLM_NIXL_BOUNCE_PUSH_GATHER, off by default) a sender maps the peer's arena when it loads the peer, and the gather kernel writes each chunk straight into the region the receiver granted, then sends DATA once the kernel has completed. There is no local staging region and no NIXL write per chunk; the receiver side is unchanged. A chunk's gather starts once its GRANT arrives. Peers whose arena cannot be mapped keep the staged path. A granted region outside the mapped arena abandons the flow. In-flight chunks and orphaned gathers hold the mapping, and a failed request whose push gather may still run defers its cancel until the kernel is done. Signed-off-by: Wanli Jiang <[email protected]>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@coderabbitai summary
Description
With
kv_cache_bounce_size_mbset, the bounce transport gathers each chunk of a KV transfer into a local staging region of its arena, posts one NIXL write of that region into the region the receiver granted, and the receiver scatters it into the destination blocks. Between NVLink peers that NIXL write is a UCXcuda_ipccopy-engine copy, and one sender's copies run one at a time: on GB300 a 128 MiB chunk copies at about 750 GB/s, but the copies queue behind each other, and a larger arena, more chunks in flight,UCX_CUDA_IPC_MAX_STREAMSorcopy_stream_countdo not change that. The staged path tops out at 55-76 % of a direct peer copy on the shapes below.This change adds
push_gather(agent_bounce_params: {push_gather: "1"}orTRTLLM_NIXL_BOUNCE_PUSH_GATHER=1, off by default):CU_MEM_HANDLE_TYPE_FABRIChandle and its address range in the bounce handshake (handshake format 2; format 1 blobs from older peers still decode, without an export).push_gathermaps the peer's arena when it loads the peer (one import and map of one allocation, 0.1-5 ms). The gather kernel then writes each chunk straight into the region the receiver granted and sends DATA once the kernel has completed. There is no local staging region and no NIXL write per chunk; the receiver side (credits, scatter, ACK) is unchanged.kProtocolError), like a credit/chunk size mispair.invalidateRemoteAgentor a reload never unmaps memory a kernel may still write. A failed request whose push gather may still be running defers its cancel until the kernel is done, as it already does for an in-flight write.The KV layouts measured here (Qwen3.8 FP8, about 98 KB per descriptor) never use bounce under the default admission gate (at least 1024 descriptors averaging at most 16 KiB), so every bounce row below also sets
min_descriptor_count: "0"andmax_average_descriptor_size: "32MB". This PR does not change the gate.Performance
Transfer benchmark on GB300 NVL72: the KV layout of Qwen3.8 FP8 (12 attention layers, 2 KV heads, head dim 256, 32 tokens per block), 16 concurrent requests of about 575 MB, the same descriptors for every path. Aggregate GB/s over the timed rounds; every run compared all bytes, 0 mismatches.
Served agentic multi-turn traffic: disaggregated, ctx TP2 + gen TP2 on one node, 256 concurrent sessions, 900 s windows, arms paired on the same node, every arm configured the same on both instances.
The standard NIXL row comes from an earlier run of the same deployment. Against it, push gather recovers 90 % of the direct peer copy's throughput gain with 128 MiB chunks; the staged path recovers 72 %. With 32 MiB chunks the remaining TTFT gap grows with prompt length and appears only in load bursts (each chunk is one GRANT / DATA / ACK round), and a larger arena alone does not close it.
Test Coverage
cpp/tests/unit_tests/executor/bounce/bounceMessageCodecTest.cpp: handshake round trip with the arena export; a format-1 blob still decodes; a truncated handle is rejected.cpp/tests/unit_tests/executor/bounce/bounceConfigTest.cpp:TRTLLM_NIXL_BOUNCE_PUSH_GATHERparses.cpp/tests/unit_tests/executor/bounce/bounceAgentE2ETest.cpp:PushGatherTransfersIntact, four concurrent multi-chunk requests withpush_gatheron, data verified (push where the arena can be mapped, staged otherwise).tests/unittest/llmapi/test_llm_args.py:test_agent_bounce_param_keys_match_cpp_env_knobscovers the new key in both allowlists.PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.