[https://nvbugs/6503299][fix] Default fabric memory KV pool for Python cache transceiver#16832
Open
chuangz0 wants to merge 1 commit into
Open
Conversation
Default TRTLLM_KVCACHE_POOL_USE_FABRIC_MEMORY=1 when the Python cache transceiver (transceiver_runtime='PYTHON') is used with the C++ V1 KV cache manager, so the KV pool is allocated with fabric memory for MNNVL transfers. Explicit user settings are respected, and unsupported platforms fall back to standard allocation in C++. Also set kv_cache_bounce_size_mb=512 in the GPT-OSS disagg perf configs where the ctx/gen KV-head sharding differs (ctx TP1 -> gen TP4), which requires the bounce buffer to regroup KV heads during transfer. Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
chuangz0
requested review from
Tabrizian,
YihuiLu512,
bo-nv,
dc3671 and
nv-ananjappa
July 24, 2026 07:24
Contributor
WalkthroughThe change enables Fabric-memory pooling for compatible Python/V1 KV-cache setups and adds a 512 MB KV-cache bounce-size setting to eight GB200 GPT-OSS NIXL benchmark configurations. ChangesKV-cache Fabric memory configuration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tensorrt_llm/_torch/pyexecutor/_util.py (1)
347-347: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd the required return annotation.
As per coding guidelines, every Python function must be annotated; declare this helper as returning
None.Proposed fix
-def _maybe_enable_fabric_memory_for_python_transceiver(self): +def _maybe_enable_fabric_memory_for_python_transceiver(self) -> None:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tensorrt_llm/_torch/pyexecutor/_util.py` at line 347, Update _maybe_enable_fabric_memory_for_python_transceiver to include an explicit None return annotation, preserving its existing behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tensorrt_llm/_torch/pyexecutor/_util.py`:
- Line 347: Update _maybe_enable_fabric_memory_for_python_transceiver to include
an explicit None return annotation, preserving its existing behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e54489eb-50c5-42cb-9963-81b94b2899ed
📒 Files selected for processing (9)
tensorrt_llm/_torch/pyexecutor/_util.pytests/scripts/perf-sanity/disaggregated/gb200_gpt-oss-120b-fp4_1k1k_con64_ctx1_tp1_gen1_tp4_eplb0_mtp0_ccb-NIXL.yamltests/scripts/perf-sanity/disaggregated/gb200_gpt-oss-120b-fp4_8k1k_con1024_ctx1_tp1_gen1_tp4_eplb0_mtp0_ccb-NIXL.yamltests/scripts/perf-sanity/disaggregated/gb200_gpt-oss-120b-fp4_8k1k_con128_ctx1_tp1_gen1_tp4_eplb0_mtp0_ccb-NIXL.yamltests/scripts/perf-sanity/disaggregated/gb200_gpt-oss-120b-fp4_8k1k_con4_ctx1_tp1_gen1_tp4_eplb0_mtp0_ccb-NIXL.yamltests/scripts/perf/disaggregated/gb200_gpt-oss-120b-fp4_8k1k_con1024_ctx1_tp1_gen1_tp4_eplb0_mtp0_ccb-NIXL.yamltests/scripts/perf/disaggregated/gb200_gpt-oss-120b-fp4_8k1k_con128_ctx1_tp1_gen1_tp4_eplb0_mtp0_ccb-NIXL.yamltests/scripts/perf/disaggregated/gb200_gpt-oss-120b-fp4_8k1k_con4_ctx1_tp1_gen1_tp4_eplb0_mtp0_ccb-NIXL.yamltests/scripts/perf/disaggregated/gb200_stress-gpt-oss-120b-fp4_8k1k_ctx1_tp1_gen1_tp4_eplb0_eagle3_ccb-NIXL.yaml
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.
Description
When the Python cache transceiver (
cache_transceiver_config.transceiver_runtime='PYTHON') is used together with the C++ V1 KV cache manager, the KV cache pool should be allocated with fabric memory so KV blocks can be transferred over MNNVL.This PR:
Defaults
TRTLLM_KVCACHE_POOL_USE_FABRIC_MEMORY=1inKvCacheCreator.__init__when:transceiver_runtime='PYTHON', andKVCacheManagerand its hybrid subclasses;KVCacheManagerV2is excluded).The default is applied before any pool allocation (the C++ env getter caches on first read). An explicit user setting is always respected, and platforms without fabric memory support fall back to standard GPU allocation in C++ with a warning.
Sets
kv_cache_bounce_size_mb: 512in the GPT-OSS disaggregated perf configs (from [None][perf] Validate GPT-OSS transceiver v2 performance #15765) where the ctx/gen KV-head sharding differs (ctx TP1 → gen TP4, no attention DP), which requires the bounce buffer to regroup KV heads during transfer. Configs with matching per-rank KV-head layout (equal TP, or gen with attention DP) are intentionally left unchanged.Test Coverage
transceiver_runtime: PYTHON.PR Checklist
🤖 Generated with Claude Code
Dev Engineer Review
TRTLLM_KVCACHE_POOL_USE_FABRIC_MEMORYsettings and falls back with a warning on unsupported platforms.kv_cache_bounce_size_mb: 512to GPT-OSS disaggregated configurations requiring KV-head regrouping; matching-layout configurations remain unchanged.QA Engineer Review