[None][feat] KV cache manager v2 + python transceiver bug fix - #12928
Conversation
7487f9b to
a890eb6
Compare
|
/bot run --disable-fail-test |
📝 WalkthroughWalkthroughThese changes introduce VMM-aware descriptor splitting utilities and serialization support for AgentDesc. New public types (VramRegionInfo, VramRegionMap, VmmDescSplitter) provide backend-agnostic VRAM descriptor management with region detection and chunk-aligned splitting. AgentDesc extended with serialize/deserialize APIs and VMM region metadata. NixlTransferAgent refactored to delegate descriptor handling to VmmDescSplitter. Scheduler and resource manager enhanced for coordinated KV cache allocation and early index slot release. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
PR_Github #42695 Bot args parsing error: usage: /bot [-h] |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cpp`:
- Around line 653-664: The cached remote region map
(mRemoteVramRegionInfo[name]) must be replaced on agent reload instead of only
updating when agentDesc.getVramRegions() is non-empty; clear or erase the
existing remoteMap for the agent (identified by name) before populating it so
stale entries aren't kept when regions are removed or empty, ensuring
VmmDescSplitter::splitTransferDescsWithRegionMaps and submitTransferRequests()
use the current remote region set.
In `@cpp/tensorrt_llm/executor/cache_transmission/transferAgent.cpp`:
- Around line 80-98: AgentDesc::deserialize currently calls
regions.reserve(numRegions) using an untrusted numRegions from the payload which
can cause huge allocations; validate numRegions before reserving by checking it
against the remaining stream length or a reasonable maximum (e.g., derive
maxRegions from data.size() or a defined constant) and fail early if it's out of
range, then only call regions.reserve(validatedNumRegions); ensure the
validation logic happens before using numRegions and reference the
variables/functions AgentDesc::deserialize, numRegions, regions.reserve, and the
input stream `is`.
- Around line 257-264: The current global detectedChunkSize enforcement in
splitVmmDescs() (the if block comparing detectedChunkSize and chunkSize)
incorrectly rejects valid mixed-pool registrations; remove or relax that check
so callers can register VMM pools with different chunk sizes and let per-region
metadata in VramRegionMap/AgentDesc carry chunkSize instead. Concretely, delete
the global consistency check around detectedChunkSize and stop writing a single
detectedChunkSize out for registerMemory(); instead ensure chunkSize is recorded
on each AgentDesc/VramRegion entry created by splitVmmDescs() so
registerMemory() and downstream logic read the per-region chunk sizes rather
than relying on a global detectedChunkSize.
- Around line 155-206: The function
VmmDescSplitter::splitTransferDescsWithRegionMaps currently returns early when
srcDescs.getType() != MemoryType::kVRAM, which skips VRAM chunk splitting for
DRAM↔VRAM transfers; change the logic to handle cases where either side is VRAM:
iterate over paired srcVec/dstVec regardless of src type, use lookupChunkInfo
against localRegionMap when splitting VRAM on the source and against
remoteRegionMap when splitting VRAM on the destination, and when only one side
needs splitting produce matching piece entries for the other side (reuse the
original srcVec[i] or dstVec[i] addresses/device ids but with pieceSize
fragments) so splitSrc and splitDst remain aligned; update the code paths around
srcChunkSize/dstChunkSize, srcBase/dstBase, and the while loop to compute
pieceSize from whichever chunk sizes are nonzero and push fragmented MemoryDesc
entries into splitSrc/splitDst accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: df50b36a-7e50-4d83-9694-d9153ef96755
📒 Files selected for processing (13)
cpp/include/tensorrt_llm/executor/transferAgent.hcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/CMakeLists.txtcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/agentBindings.cppcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cppcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/tensorrt_llm/executor/cache_transmission/transferAgent.cppcpp/tests/unit_tests/executor/transferAgentTest.cpptensorrt_llm/_torch/disaggregation/nixl/_agent_cpp.pytensorrt_llm/_torch/pyexecutor/py_executor.pytensorrt_llm/_torch/pyexecutor/resource_manager.pytensorrt_llm/_torch/pyexecutor/scheduler/scheduler_v2.pytensorrt_llm/runtime/kv_cache_manager_v2/_cuda_virt_mem.pytests/unittest/bindings/test_transfer_agent_bindings.py
|
/bot --help |
GitHub Bot Help
Provide a user friendly way for developers to interact with a Jenkins server. Run See details below for each supported subcommand. Details
Launch build/test pipelines. All previously running jobs will be killed.
kill
Kill all running builds associated with pull request. skip
Skip testing for latest commit on pull request. reuse-pipeline
Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break. |
|
/bot run --disable-fail-fast |
|
PR_Github #42920 [ run ] triggered by Bot. Commit: |
|
PR_Github #42920 [ run ] completed with state
|
54ed889 to
d9d271a
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #43214 [ run ] triggered by Bot. Commit: |
|
PR_Github #43214 [ run ] completed with state |
d9d271a to
c155506
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #43374 [ run ] triggered by Bot. Commit: |
|
PR_Github #43374 [ run ] completed with state
|
02ece78 to
5c8fbae
Compare
|
/bot run --disable-fail-fast |
01d491e to
9c6014c
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #49353 [ run ] triggered by Bot. Commit: |
|
PR_Github #49353 [ run ] completed with state
|
9c6014c to
634d182
Compare
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
…i chunk Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
634d182 to
270827d
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #49600 [ run ] triggered by Bot. Commit: |
|
PR_Github #49600 [ run ] completed with state |
…#12928) Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
…#12928) Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
…#12928) Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…#12928) Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…#12928) Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Summary by CodeRabbit
Release Notes
New Features
Tests
Description
Test Coverage
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)
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.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.