Skip to content

Commit e42c0e7

Browse files
committed
moves types around
Signed-off-by: Sage Moore <[email protected]>
1 parent 32fb038 commit e42c0e7

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

vllm/compilation/ubatch_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from dataclasses import dataclass
2+
from typing import TypeAlias
3+
4+
@dataclass
5+
class UbatchSlice:
6+
request_slice: slice
7+
token_slice: slice
8+
UBatchSlices: TypeAlias = list[UbatchSlice]

vllm/compilation/ubatch_wrapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
logger = init_logger(__name__)
2121

22-
2322
@dataclasses.dataclass
2423
class UbatchMetadata:
2524
context: UBatchContext

vllm/forward_context.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@
1313
import vllm.envs as envs
1414
from vllm.config import CUDAGraphMode, ParallelConfig, VllmConfig
1515
from vllm.logger import init_logger
16-
from typing import TypeAlias
17-
18-
@dataclass
19-
class UbatchSlice:
20-
request_slice: slice
21-
token_slice: slice
22-
UBatchSlices: TypeAlias = list[UbatchSlice]
16+
from vllm.compilation.ubatch_utils import (UbatchSlice, UBatchSlices)
2317

2418
if TYPE_CHECKING:
2519
from vllm.attention.backends.abstract import AttentionMetadata

vllm/v1/attention/backends/utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from vllm.logger import init_logger
3030
from vllm.v1.kv_cache_interface import AttentionSpec
3131

32+
from vllm.compilation.ubatch_utils import UbatchSlice
33+
3234
logger = init_logger(__name__)
3335
_KV_CACHE_LAYOUT_OVERRIDE = None
3436

@@ -73,12 +75,6 @@ class CommonAttentionMetadata:
7375
num_logits_indices: Optional[int] = None
7476

7577

76-
@dataclass
77-
class UbatchSlice:
78-
request_slice: slice
79-
token_slice: slice
80-
81-
8278
def slice_query_start_locs(
8379
query_start_loc: torch.Tensor,
8480
request_slice: slice,

vllm/v1/worker/gpu_model_runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from vllm.compilation.cuda_graph import CUDAGraphWrapper
2525
from vllm.compilation.monitor import set_cudagraph_capturing_enabled
2626
from vllm.compilation.ubatch_wrapper import UBatchWrapper
27+
from vllm.compilation.ubatch_utils import (UbatchSlice, UBatchSlices)
2728
from vllm.config import (CompilationLevel, CUDAGraphMode, VllmConfig,
2829
get_layers_from_vllm_config, update_config)
2930
from vllm.distributed.eplb.eplb_state import EplbState
@@ -109,8 +110,6 @@
109110
PerLayerAttnMetadata: TypeAlias = Union[list[AttnMetadataDict],
110111
AttnMetadataDict]
111112

112-
UBatchSlices: TypeAlias = list[UbatchSlice]
113-
114113

115114
class GPUModelRunner(LoRAModelRunnerMixin, KVConnectorModelRunnerMixin):
116115

0 commit comments

Comments
 (0)