Skip to content
Open
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
43 changes: 29 additions & 14 deletions tensorrt_llm/commands/mooncake.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@

import tensorrt_llm.usage as usage
from tensorrt_llm.commands import _telemetry as _command_telemetry
from tensorrt_llm.commands._serve_stability import stability_option
from tensorrt_llm.logger import logger
from tensorrt_llm.usage.config import UsageContext

#: Both commands sit in the telemetry-aware `trtllm-serve` group, so they offer
#: the same opt-out the group documents.
_telemetry_option = click.option(
_telemetry_option = stability_option(
"--telemetry/--no-telemetry",
default=True,
help="Enable or disable anonymous usage telemetry collection.",
status="beta",
)


Expand Down Expand Up @@ -88,29 +90,32 @@ def _signal_handoff():


@click.command("mooncake_master")
@click.option(
@stability_option(
"--rpc_port",
type=int,
default=50051,
show_default=True,
help="Port the store clients reach the master on.",
status="prototype",
)
@click.option(
@stability_option(
"--metrics_port",
type=int,
default=9004,
show_default=True,
help="Prometheus port. Pool occupancy and eviction are read "
"from here or from the master's log.",
status="prototype",
)
@click.option(
@stability_option(
"--eviction_ratio",
type=float,
default=0.05,
show_default=True,
help="Fraction of the pool freed per eviction pass.",
status="prototype",
)
@click.option(
@stability_option(
"--pool_file",
type=str,
default=None,
Expand All @@ -119,60 +124,68 @@ def _signal_handoff():
"file://<path>, which is how they reach a master whose host "
"the scheduler chose. Removed on exit so a stale address is "
"never dialed. One is written to --run_dir regardless.",
status="prototype",
)
@click.option(
@stability_option(
"--protocol",
type=str,
default="rdma",
show_default=True,
help="Transport every participant will use: 'rdma' or 'tcp'. "
"Recorded in the manifest so the servers need not restate it. "
"TCP is for bring-up only; it invalidates performance conclusions.",
status="prototype",
)
@click.option(
@stability_option(
"--metadata_server",
type=str,
default="P2PHANDSHAKE",
show_default=True,
help="Mooncake metadata service, recorded in the manifest. "
"P2PHANDSHAKE keeps a separate metadata process out of the deployment.",
status="prototype",
)
@click.option(
@stability_option(
"--namespace",
type=str,
default="trtllm",
show_default=True,
help="Default key namespace for this pool, recorded in the manifest. A server may override it.",
status="prototype",
)
@click.option(
@stability_option(
"--run_dir",
type=str,
default=None,
help="Where to keep the master's log and a copy of the "
"manifest. Defaults to a temporary directory.",
status="prototype",
)
@click.option(
@stability_option(
"--binary",
type=str,
default="mooncake_master",
show_default=True,
help="The master executable to run, looked up on PATH. It "
"ships with the Mooncake runtime that "
"docker/common/install_mooncake.sh installs.",
status="prototype",
)
@click.option(
@stability_option(
"--timeout",
type=float,
default=60.0,
show_default=True,
help="Seconds to wait for the master to accept connections before giving up on it.",
status="prototype",
)
@click.option(
@stability_option(
"--heartbeat_seconds",
type=int,
default=300,
show_default=True,
help="Interval between liveness lines. 0 disables them.",
status="prototype",
)
@_telemetry_option
def mooncake_master(
Expand Down Expand Up @@ -245,19 +258,21 @@ def mooncake_master(


@click.command("mooncake_pool_report")
@click.option(
@stability_option(
"--run_dir",
type=str,
required=True,
help="Directory holding the pool manifest and the segments/ "
"records each participating rank wrote.",
status="prototype",
)
@click.option(
@stability_option(
"--master_log",
type=str,
default=None,
help="The master's log, for the block-placement table. "
"Defaults to mooncake_master.log in --run_dir.",
status="prototype",
)
@_telemetry_option
def mooncake_pool_report(run_dir: str, master_log: Optional[str], telemetry: bool):
Expand Down
95 changes: 56 additions & 39 deletions tensorrt_llm/commands/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1817,63 +1817,80 @@ def serve_encoder(

@click.command("embeddings")
@click.argument("model", type=str)
@click.option("--host",
type=str,
default="localhost",
help="Hostname of the server.")
@click.option("--port", type=int, default=8000, help="Port of the server.")
@click.option('--log_level',
type=click.Choice(severity_map.keys()),
default='info',
help="The logging level.")
@click.option("--max_batch_size",
type=int,
default=_LLM_ARGS_FIELDS["max_batch_size"].default,
help="Maximum batch size coalesced into a single encode() call.")
@click.option(
@stability_option("--host",
type=str,
default="localhost",
help="Hostname of the server.",
status="beta")
@stability_option("--port",
type=int,
default=8000,
help="Port of the server.",
status="beta")
@stability_option('--log_level',
type=click.Choice(severity_map.keys()),
default='info',
help="The logging level.",
status="beta")
@stability_option(
"--max_batch_size",
type=int,
default=_LLM_ARGS_FIELDS["max_batch_size"].default,
help="Maximum batch size coalesced into a single encode() call.",
status="beta")
@stability_option(
"--max_num_tokens",
type=int,
default=8192,
help="Maximum number of batched input tokens in each encode() call.")
@click.option(
help="Maximum number of batched input tokens in each encode() call.",
status="beta")
@stability_option(
"--max_queue_delay",
type=click.FloatRange(min=0.0),
default=0.005,
help="Dynamic-batching hold window in seconds: how long an incoming request "
"waits for others to join its batch before being dispatched (mirrors Triton's "
"max_queue_delay_microseconds).")
@click.option(
"max_queue_delay_microseconds).",
status="prototype")
@stability_option(
"--max_queue_size",
type=click.IntRange(min=1),
default=2048,
help="Maximum number of in-flight queued requests; further requests are "
"rejected with HTTP 429 (mirrors Triton's max_queue_size).")
@click.option("--trust_remote_code",
is_flag=True,
default=False,
help="Flag for HF transformers.")
@click.option(
"rejected with HTTP 429 (mirrors Triton's max_queue_size).",
status="prototype")
@stability_option("--trust_remote_code",
is_flag=True,
default=False,
help="Flag for HF transformers.",
status="beta")
@stability_option(
"--config",
"--extra_llm_api_options",
"extra_llm_api_options",
type=str,
default=None,
help="Path to a YAML configuration file. Explicit CLI flags take precedence "
"over values in this file.")
@click.option("--hf_revision",
"--revision",
"revision",
type=str,
default=None,
help="The revision to use for the HuggingFace model "
"(branch name, tag name, or commit id).")
@click.option("--metadata_server_config_file",
type=str,
default=None,
help="Path to metadata server config file")
@click.option("--telemetry/--no-telemetry",
default=True,
help="Enable or disable anonymous usage telemetry collection.")
"over values in this file.",
status="prototype")
@stability_option("--hf_revision",
"--revision",
"revision",
type=str,
default=None,
help="The revision to use for the HuggingFace model "
"(branch name, tag name, or commit id).",
status="beta")
@stability_option("--metadata_server_config_file",
type=str,
default=None,
help="Path to metadata server config file",
status="prototype")
@stability_option(
"--telemetry/--no-telemetry",
default=True,
help="Enable or disable anonymous usage telemetry collection.",
status="beta")
def serve_embedding(
model: str,
host: str,
Expand Down
Loading
Loading