Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 17 additions & 2 deletions tensorrt_llm/llmapi/disagg_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from dataclasses import dataclass, field
from enum import Enum
from enum import IntEnum
from typing import Any, List, Literal, Optional, Tuple

import yaml
Expand All @@ -16,7 +16,7 @@
]


class ServerRole(Enum):
class ServerRole(IntEnum):
CONTEXT = 0
GENERATION = 1
MM_ENCODER = 2
Expand All @@ -43,6 +43,21 @@ class ConditionalDisaggConfig():
max_local_prefill_length: int = 0


@dataclass
class MinimalInstances:
context_servers: int = 1 # the minimal number of context servers
generation_servers: int = 1 # the minimal number of generation servers


@dataclass
class DisaggClusterConfig:
cluster_uri: str # the uri of the cluster storage
cluster_name: str = "" # the name of the cluster, used like a namespace
minimal_instances: Optional[MinimalInstances] = None
heartbeat_interval_sec: int = 5 # the worker will send heartbeat to the cluster storage every heartbeat_interval_sec seconds
inactive_timeout_sec: int = 10 # the worker will be considered inactive if it doesn't send heartbeat for inactive_timeout_sec seconds


@dataclass
class DisaggServerConfig():
server_configs: List[CtxGenServerConfig]
Expand Down
Loading