config: constructing a config no longer resolves it (#35907)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
4bc79a1b49
commit
64aa859da2
@@ -48,6 +48,11 @@ def _launch_server_target(launch_server_func: Callable, server_args: ServerArgs)
|
||||
|
||||
|
||||
def launch_or_reuse_server(launch_server_func: Callable, server_args: ServerArgs):
|
||||
# Resolve in the parent, before the fork. The pipeline probes the device
|
||||
# (the default attention backend reads the CUDA capability), and a forked
|
||||
# child cannot re-initialize CUDA once this process has.
|
||||
server_args.resolve_once()
|
||||
|
||||
base_url = resolve_base_url("", server_args.host, server_args.port)
|
||||
|
||||
# Reuse an already-running server instead of forking a second one onto the
|
||||
|
||||
@@ -398,7 +398,7 @@ def _create_ray_engine_backend(server_args: ServerArgs):
|
||||
placement_group=pg,
|
||||
placement_group_bundle_index=0,
|
||||
),
|
||||
).remote(**dataclasses.asdict(server_args))
|
||||
).remote(**dict(server_args._raw_input))
|
||||
|
||||
class _Proxy:
|
||||
"""Forwards method calls to the remote RayEngine actor."""
|
||||
@@ -432,15 +432,18 @@ def throughput_test(
|
||||
server_args: ServerArgs,
|
||||
bench_args: BenchArgs,
|
||||
):
|
||||
# A programmatic caller may hand over a freshly constructed record, and
|
||||
# the backends below read the resolved paths and the raw snapshot.
|
||||
server_args.resolve_once()
|
||||
if bench_args.backend == "engine":
|
||||
if server_args.use_ray:
|
||||
backend = _create_ray_engine_backend(server_args)
|
||||
else:
|
||||
backend = Engine(**dataclasses.asdict(server_args))
|
||||
backend = Engine(server_args=server_args)
|
||||
if not backend:
|
||||
raise ValueError("Please provide valid engine arguments")
|
||||
elif bench_args.backend == "runtime":
|
||||
backend = Runtime(**dataclasses.asdict(server_args))
|
||||
backend = Runtime(**dict(server_args._raw_input))
|
||||
else:
|
||||
raise ValueError('Please set backend to either "engine" or "runtime"')
|
||||
|
||||
@@ -569,6 +572,7 @@ def cli_main():
|
||||
raise e
|
||||
|
||||
server_args = ServerArgs.from_cli_args(args)
|
||||
server_args.resolve_once()
|
||||
bench_args = BenchArgs.from_cli_args(args)
|
||||
|
||||
logging.basicConfig(
|
||||
|
||||
@@ -989,8 +989,10 @@ def latency_test(
|
||||
|
||||
|
||||
def main(server_args, bench_args):
|
||||
# Post-init write to the legacy cuda_graph_max_bs_decode field would
|
||||
# not propagate to cuda_graph_config; update the decode phase directly.
|
||||
server_args.resolve_once()
|
||||
|
||||
# The legacy cuda_graph_max_bs_decode field does not propagate; set the
|
||||
# decode phase.
|
||||
if server_args.cuda_graph_config is not None:
|
||||
server_args.cuda_graph_config[Phase.DECODE].max_bs = max(bench_args.batch_size)
|
||||
|
||||
|
||||
@@ -1255,6 +1255,7 @@ def cli_main():
|
||||
args = parser.parse_args()
|
||||
|
||||
server_args = ServerArgs.from_cli_args(args)
|
||||
server_args.resolve_once()
|
||||
bench_args = BenchArgs.from_cli_args(args)
|
||||
|
||||
run_benchmark(server_args, bench_args)
|
||||
|
||||
Reference in New Issue
Block a user