Skip to content
Open
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
13 changes: 12 additions & 1 deletion miles/utils/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
logger = logging.getLogger(__name__)


def is_external_model_server(args) -> bool:
"""Return whether rollout runs against an external SGLang model server.

In this mode ``sglang_router_ip`` points at a long-lived remote server and no
local rollout GPUs are allocated, so the framework should skip Megatron argument
validation (which reads CUDA device properties) to allow evals to run on
CPU-only pods with no NVIDIA driver.
"""
return getattr(args, "sglang_router_ip", None) is not None and args.rollout_num_gpus == 0
Comment thread
surega21 marked this conversation as resolved.


def reset_arg(parser, name, **kwargs):
"""
Reset the default value of a Megatron argument.
Expand Down Expand Up @@ -2170,7 +2181,7 @@ def parse_args(add_custom_arguments=None):

miles_validate_args(args)

if backend == "megatron":
if backend == "megatron" and not is_external_model_server(args):
megatron_validate_args(args)

# always use varlen
Expand Down