Skip to content

Commit

Permalink
Fix the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
s5u13b committed Oct 16, 2024
1 parent 5260f8e commit 831f4ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
9 changes: 8 additions & 1 deletion llumnix/arg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def add_argument(self, *args, **kwargs):
super().add_argument(*args, **kwargs)


# All the default values of llumnix arguments are setted in default.py. So all the arguments here are setted to None.
# All the default values of llumnix arguments are set in default.py. So all the arguments here are set to None.

@dataclass
class LlumnixEntrypointsArgs:
Expand All @@ -67,6 +67,13 @@ def from_llumnix_config(cls, cfg: LlumnixConfig = get_llumnix_config()) -> 'Llum
llumnix_entrypoints_args = cls(**{attr: getattr(cfg.SERVER, attr.upper()) for attr in attrs})
return llumnix_entrypoints_args

@classmethod
def check_args(cls, args: 'LlumnixEntrypointsArgs', parser: argparse.ArgumentParser):
# pylint: disable=protected-access
for action in parser._optionals._actions:
if hasattr(action, 'choices') and action.choices is not None and hasattr(args, action.dest):
assert getattr(args, action.dest) in action.choices, f"{action.dest} should be one of {action.choices}."

@staticmethod
def add_cli_args(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
parser.add_argument('--launch-ray-cluster',
Expand Down
2 changes: 1 addition & 1 deletion llumnix/entrypoints/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from llumnix.server_info import ServerInfo, RequestTimestamps
from llumnix.queue.utils import init_output_queue_server

logger = init_logger("llumnix.api_server")
logger = init_logger(__name__)

# TODO(s5u13b): Set the values through tests.
MAX_RESTARTS = 30
Expand Down
3 changes: 2 additions & 1 deletion llumnix/entrypoints/vllm/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
from llumnix.utils import random_uuid
from llumnix.config import get_llumnix_config, LlumnixConfig

logger = init_logger("llumnix.api_server")
# Code file with __main__ should set the logger name to inherit the llumnix logger configuration.
logger = init_logger("llumnix.entrypoints.vllm.api_server")

TIMEOUT_KEEP_ALIVE = 5 # seconds.

Expand Down
3 changes: 2 additions & 1 deletion llumnix/entrypoints/vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from llumnix.entrypoints.utils import LlumnixEntrypointsContext
from llumnix.server_info import RequestTimestamps

logger = init_logger("llumnix.api_server")
logger = init_logger(__name__)

WAIT_MANAGER_INTERVAL = 5

Expand All @@ -29,6 +29,7 @@ def add_cli_args(parser):

def get_args(cfg, parser, cli_args):
llumnix_entrypoints_args = LlumnixEntrypointsArgs.from_llumnix_config(cfg)
LlumnixEntrypointsArgs.check_args(llumnix_entrypoints_args, parser)
engine_manager_args = EngineManagerArgs.from_llumnix_config(cfg)
EngineManagerArgs.check_args(engine_manager_args, parser)
engine_args = AsyncEngineArgs.from_cli_args(cli_args)
Expand Down

0 comments on commit 831f4ca

Please sign in to comment.