Skip to content

Commit b63bb16

Browse files
hmelloreicherseiji
authored andcommitted
Move KVEventsConfig from config/__init__.py to config/kv_events.py (vllm-project#24433)
Signed-off-by: Harry Mellor <[email protected]>
1 parent ecdae7c commit b63bb16

File tree

4 files changed

+53
-44
lines changed

4 files changed

+53
-44
lines changed

tests/distributed/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pytest
99
import zmq
1010

11-
from vllm.config import KVEventsConfig
11+
from vllm.config.kv_events import KVEventsConfig
1212
from vllm.distributed.kv_events import EventPublisherFactory
1313

1414
from .test_events import SampleBatch

vllm/config/__init__.py

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
PrefixCachingHashAlgo)
3434
from vllm.config.compilation import (CompilationConfig, CompilationLevel,
3535
CUDAGraphMode, PassConfig)
36+
from vllm.config.kv_events import KVEventsConfig
3637
from vllm.config.parallel import (DistributedExecutorBackend, EPLBConfig,
3738
ParallelConfig)
3839
from vllm.config.scheduler import SchedulerConfig, SchedulerPolicy
@@ -3310,48 +3311,6 @@ def get_from_extra_config(self, key, default) -> Any:
33103311
return self.kv_connector_extra_config.get(key, default)
33113312

33123313

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-
33553314
@config
33563315
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
33573316
class VllmConfig:

vllm/config/kv_events.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import msgspec
1515
import zmq
1616

17-
from vllm.config import KVEventsConfig
17+
from vllm.config.kv_events import KVEventsConfig
1818
from vllm.logger import init_logger
1919

2020
logger = init_logger(__name__)

0 commit comments

Comments
 (0)