Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
92b8fd3
feat: publish native v2 kv cache events
alec-flowers Jul 25, 2026
195fd1d
perf: optimize native v2 kv event production
alec-flowers Jul 26, 2026
7c58c0d
refactor: streamline native KV event manager
tanmayv25 Jul 29, 2026
5a66ee1
refactor: nest KV events config under KvCacheConfig
tanmayv25 Jul 29, 2026
92f92de
fix: address independent review of native KV events
tanmayv25 Jul 29, 2026
902c2ee
refactor: collapse KVEventAdapter into NativeKVCacheEventManager
tanmayv25 Jul 29, 2026
bee8413
fix: address xhigh code-review findings for native KV events
tanmayv25 Jul 29, 2026
8f3474b
fix: address native KV events review comments
tanmayv25 Aug 5, 2026
c70dc15
test: align native KV event wire-hash assertions with truncation change
tanmayv25 Aug 10, 2026
6e46ee7
refactor: drop _NativeStoredBlockState wrapper; test config+endpoint …
tanmayv25 Aug 10, 2026
3a9bf62
refactor: rename KV events 'native/legacy' -> 'streaming/buffered'
tanmayv25 Aug 10, 2026
69b318a
fix: address code-review findings for streaming KV events
tanmayv25 Aug 11, 2026
99f1ebb
Merge remote-tracking branch 'origin/main' into worktree-trtllm-kv-ev…
tanmayv25 Aug 11, 2026
b92128a
refactor: name the KV event wire format in TensorRT-LLM terms
tanmayv25 Aug 12, 2026
e01518a
fix: validate KV event endpoint port and fix test formatting
tanmayv25 Aug 12, 2026
9a98953
style: fix llm_utils.py import order after merge
tanmayv25 Aug 12, 2026
4ebfac8
fix: address streaming KV event review feedback
GuanLuo Aug 13, 2026
eb15c9e
Merge remote-tracking branch 'upstream/main' into feat/native-kv-even…
GuanLuo Aug 25, 2026
e425ac1
fix: address streaming KV event review comments
GuanLuo Aug 26, 2026
60759b6
Merge remote-tracking branch 'upstream/main' into feat/native-kv-even…
GuanLuo Aug 26, 2026
44004b3
refactor: start the streaming KV event publisher explicitly
GuanLuo Aug 26, 2026
a812f19
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 26, 2026
94719ab
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 26, 2026
ab55d43
fix: synchronise the streaming KV event test on the subscription
GuanLuo Aug 26, 2026
aa7510a
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 27, 2026
3d75a66
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 27, 2026
189f1d3
Merge branch 'main' into feat/native-kv-events-clean
GuanLuo Aug 28, 2026
ac4bc02
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 29, 2026
8ec0f0f
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 29, 2026
573b40e
fix early return for rank 0
allisonlim-nv Aug 30, 2026
e959a29
fix malformed llm args import
allisonlim-nv Aug 30, 2026
177ccfc
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 30, 2026
4716843
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 31, 2026
9f598a6
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Aug 31, 2026
7b1b80d
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 1, 2026
678a4c7
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 1, 2026
e78a11f
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 1, 2026
700f603
Fix KV cache manager merge resolution
allisonlim-nv Sep 1, 2026
b80e40b
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 2, 2026
f14a3b7
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 2, 2026
6272bde
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 2, 2026
609972f
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 3, 2026
38bf92a
fix: validate the KV event port span on every rank
GuanLuo Sep 3, 2026
0333b67
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 4, 2026
e384912
Merge remote-tracking branch 'upstream/main' into feat/native-kv-even…
GuanLuo Sep 4, 2026
1e89c30
Merge remote-tracking branch 'upstream/main' into feat/native-kv-even…
GuanLuo Sep 7, 2026
16b5b4b
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 7, 2026
e40d3b2
fix: resolve KV cache manager signature merge conflict
allisonlim-nv Sep 7, 2026
d5d3337
fix: preserve joint KV cache reuse during merge resolution
allisonlim-nv Sep 7, 2026
7139362
Merge branch 'main' into feat/native-kv-events-clean
allisonlim-nv Sep 8, 2026
bd3daf2
Merge branch 'main' into feat/native-kv-events-clean
GuanLuo Sep 8, 2026
b27049b
Merge branch 'main' into feat/native-kv-events-clean
GuanLuo Sep 8, 2026
4f6e9f6
Merge branch 'main' into feat/native-kv-events-clean
thorjohnsen Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions tensorrt_llm/_torch/pyexecutor/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
# isort: off
from tensorrt_llm.llmapi.llm_args import (
CacheTransceiverConfig, CapacitySchedulerPolicy, EagleDecodingConfig,
KvCacheCompressionConfig, KvCacheConfig, MTPDecodingConfig, PeftCacheConfig,
SamplerType, SchedulerConfig, SparseAttentionConfig, SpeculativeConfig,
TorchLlmArgs, WaitingQueuePolicy)
KVEventsConfig, KvCacheCompressionConfig, KvCacheConfig, MTPDecodingConfig,
PeftCacheConfig, SamplerType, SchedulerConfig, SparseAttentionConfig,
SpeculativeConfig, TorchLlmArgs, WaitingQueuePolicy)
# isort: on
from tensorrt_llm.logger import logger
from tensorrt_llm.lora_helper import (LoraConfig,
Expand Down Expand Up @@ -1142,6 +1142,9 @@ def _create_kv_cache_manager(
execution_stream=self._execution_stream,
layer_mask=spec_dec_layer_mask,
is_disagg=self._is_disagg,
kv_events_config=None
if estimating_kv_cache or model_engine.is_draft_model else
self._llm_args.kv_cache_config.kv_events_config,
)

if not self._skip_est:
Expand Down Expand Up @@ -1858,7 +1861,8 @@ def _create_kv_cache_manager(
num_kv_heads: Optional[Union[int, List[int]]] = None,
head_dim: Optional[int] = None,
kv_cache_type=None,
is_disagg: bool = False) -> KVCacheManager:
is_disagg: bool = False,
kv_events_config: Optional[KVEventsConfig] = None) -> KVCacheManager:
"""
Returns:
A KVCacheManager instance for the given model engine or model config
Expand Down Expand Up @@ -1989,6 +1993,12 @@ def _create_kv_cache_manager(
manager_extra_kwargs = {}
if issubclass(kv_cache_manager_cls, KVCacheManagerV2):
manager_extra_kwargs["enable_stats"] = enable_kv_cache_stats
manager_extra_kwargs["kv_events_config"] = kv_events_config
elif kv_events_config is not None and kv_events_config.enable_kv_cache_events:
logger.warning(
"kv_cache_config.kv_events_config is set but native KV event "
"publishing requires KV cache manager V2; events will not be "
f"published for {kv_cache_manager_cls.__name__}.")
if issubclass(kv_cache_manager_cls, MambaHybridCacheManagerV2):
manager_extra_kwargs["is_disagg"] = is_disagg

Expand Down
Loading