@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 03dd652c16
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

Move `KVEventsConfig` from `config/__init__.py` to `config/kv_events.py` (#24433)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

Harry Mellor committed Sep 8, 2025 at 14:41 UTC 03dd652c16f8aa53190277cb1e48c5938caf6d76
4 files changed +53 -44
tests/distributed/conftest.py
+1 -1
@@ -8,7 +8,7 @@ import msgspec.msgpack
8 import pytest
9 import zmq
10
11 -from vllm.config import KVEventsConfig
11 +from vllm.config.kv_events import KVEventsConfig
12 from vllm.distributed.kv_events import EventPublisherFactory
13
14 from .test_events import SampleBatch
vllm/config/__init__.py
+1 -42
@@ -33,6 +33,7 @@ from vllm.config.cache import (BlockSize, CacheConfig, CacheDType, MambaDType,
33 PrefixCachingHashAlgo)
34 from vllm.config.compilation import (CompilationConfig, CompilationLevel,
35 CUDAGraphMode, PassConfig)
36 +from vllm.config.kv_events import KVEventsConfig
37 from vllm.config.parallel import (DistributedExecutorBackend, EPLBConfig,
38 ParallelConfig)
39 from vllm.config.scheduler import SchedulerConfig, SchedulerPolicy
@@ -3310,48 +3311,6 @@ class KVTransferConfig:
3311 return self.kv_connector_extra_config.get(key, default)
3312
3313
3313 -@config
3314 -@dataclass
3315 -class KVEventsConfig:
3316 - """Configuration for KV event publishing."""
3317 -
3318 - enable_kv_cache_events: bool = False
3319 - """If True, enable KV cache events for tracking block storage and removal.
3320 - Events can be published externally by zmq using the event publisher config.
3321 - """
3322 -
3323 - publisher: str = "null"
3324 - """The publisher to use for publishing kv events. Can be "null", "zmq".
3325 - """
3326 -
3327 - endpoint: str = "tcp://*:5557"
3328 - """The zmq endpoint to use for publishing kv events.
3329 - """
3330 -
3331 - replay_endpoint: Optional[str] = None
3332 - """The zmq endpoint to use for replaying kv events.
3333 - """
3334 -
3335 - buffer_steps: int = 10_000
3336 - """The number of steps to cache for replay endpoint. Will only save
3337 - events from the last N steps for the replay endpoint.
3338 - """
3339 -
3340 - hwm: int = 100_000
3341 - """The zmq high water mark for the event publisher. After queueing N events,
3342 - events will start dropping if the consumer is not keeping up.
3343 - """
3344 -
3345 - max_queue_size: int = 100_000
3346 - """The maximum number of events to queue while waiting for publishing.
3347 - """
3348 -
3349 - topic: str = ""
3350 - """The topic to use for the event publisher. Consumers can subscribe to
3351 - this topic to receive events.
3352 - """
3353 -
3354 -
3314 @config
3315 @dataclass(config=ConfigDict(arbitrary_types_allowed=True))
3316 class VllmConfig:
vllm/config/kv_events.py new
+50
@@ -0,0 +1,50 @@
1 +# SPDX-License-Identifier: Apache-2.0
2 +# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 +from typing import Optional
5 +
6 +from pydantic.dataclasses import dataclass
7 +
8 +from vllm.config.utils import config
9 +
10 +
11 +@config
12 +@dataclass
13 +class KVEventsConfig:
14 + """Configuration for KV event publishing."""
15 +
16 + enable_kv_cache_events: bool = False
17 + """If True, enable KV cache events for tracking block storage and removal.
18 + Events can be published externally by zmq using the event publisher config.
19 + """
20 +
21 + publisher: str = "null"
22 + """The publisher to use for publishing kv events. Can be "null", "zmq".
23 + """
24 +
25 + endpoint: str = "tcp://*:5557"
26 + """The zmq endpoint to use for publishing kv events.
27 + """
28 +
29 + replay_endpoint: Optional[str] = None
30 + """The zmq endpoint to use for replaying kv events.
31 + """
32 +
33 + buffer_steps: int = 10_000
34 + """The number of steps to cache for replay endpoint. Will only save
35 + events from the last N steps for the replay endpoint.
36 + """
37 +
38 + hwm: int = 100_000
39 + """The zmq high water mark for the event publisher. After queueing N events,
40 + events will start dropping if the consumer is not keeping up.
41 + """
42 +
43 + max_queue_size: int = 100_000
44 + """The maximum number of events to queue while waiting for publishing.
45 + """
46 +
47 + topic: str = ""
48 + """The topic to use for the event publisher. Consumers can subscribe to
49 + this topic to receive events.
50 + """
vllm/distributed/kv_events.py
+1 -1
@@ -14,7 +14,7 @@ from typing import Any, Callable, Optional, Union
14 import msgspec
15 import zmq
16
17 -from vllm.config import KVEventsConfig
17 +from vllm.config.kv_events import KVEventsConfig
18 from vllm.logger import init_logger
19
20 logger = init_logger(__name__)