diff --git a/miles/utils/arguments.py b/miles/utils/arguments.py index 53dcc34f8e..bcb2460c41 100644 --- a/miles/utils/arguments.py +++ b/miles/utils/arguments.py @@ -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 + + def reset_arg(parser, name, **kwargs): """ Reset the default value of a Megatron argument. @@ -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