[Rust Frontend][Bugfix] Forward --shutdown-timeout and --disable-log-stats to the managed Python engine (#45300)
Signed-off-by: Will Eaton <weaton@redhat.com>
This commit is contained in:
@@ -468,6 +468,8 @@ impl ServeArgs {
|
||||
self.runtime.model.clone(),
|
||||
self.runtime.max_model_len,
|
||||
self.runtime.language_model_only,
|
||||
self.runtime.disable_log_stats,
|
||||
self.runtime.shutdown_timeout,
|
||||
handshake_port,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -100,6 +100,40 @@ fn serve_args_auto_forward_enable_lora_to_python() {
|
||||
assert_eq!(args.managed_engine.python_args, vec!["--enable-lora"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serve_args_forward_shutdown_timeout_to_managed_engine() {
|
||||
let cli = Cli::try_parse_from([
|
||||
"vllm-rs",
|
||||
"serve",
|
||||
"Qwen/Qwen3-0.6B",
|
||||
"--shutdown-timeout",
|
||||
"60",
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
let Command::Serve(args) = cli.command else {
|
||||
panic!("expected serve args");
|
||||
};
|
||||
assert_eq!(args.runtime.shutdown_timeout, 60);
|
||||
|
||||
let config = args.to_managed_engine_config(5555);
|
||||
assert_eq!(config.python_args, vec!["--shutdown-timeout", "60"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serve_args_forward_disable_log_stats_to_managed_engine() {
|
||||
let cli = Cli::try_parse_from(["vllm-rs", "serve", "Qwen/Qwen3-0.6B", "--disable-log-stats"])
|
||||
.unwrap();
|
||||
|
||||
let Command::Serve(args) = cli.command else {
|
||||
panic!("expected serve args");
|
||||
};
|
||||
assert!(args.runtime.disable_log_stats);
|
||||
|
||||
let config = args.to_managed_engine_config(5555);
|
||||
assert_eq!(config.python_args, vec!["--disable-log-stats"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serve_args_auto_forward_python_multi_char_alias_without_separator() {
|
||||
let cli = Cli::try_parse_from(["vllm-rs", "serve", "Qwen/Qwen3-0.6B", "-tp", "2"]).unwrap();
|
||||
|
||||
@@ -72,6 +72,8 @@ impl ManagedEngineArgs {
|
||||
model: String,
|
||||
max_model_len: Option<u32>,
|
||||
language_model_only: bool,
|
||||
disable_log_stats: bool,
|
||||
shutdown_timeout: u64,
|
||||
handshake_port: u16,
|
||||
) -> ManagedEngineConfig {
|
||||
let mut python_args = self.python_args;
|
||||
@@ -83,6 +85,15 @@ impl ManagedEngineArgs {
|
||||
if language_model_only {
|
||||
python_args.push("--language-model-only".to_string());
|
||||
}
|
||||
if disable_log_stats {
|
||||
python_args.push("--disable-log-stats".to_string());
|
||||
}
|
||||
// we must pass through shutdown_timeout to the engine,
|
||||
// otherwise inflight requests get aborted on shutdown
|
||||
if shutdown_timeout > 0 {
|
||||
python_args.push("--shutdown-timeout".to_string());
|
||||
python_args.push(shutdown_timeout.to_string());
|
||||
}
|
||||
if let Some(data_parallel_size_local) = self.data_parallel_size_local {
|
||||
python_args.push("--data-parallel-size-local".to_string());
|
||||
python_args.push(data_parallel_size_local.to_string());
|
||||
|
||||
Reference in New Issue
Block a user