From 4250dacbe856d072b28d05fb59e88d7591c4a7f7 Mon Sep 17 00:00:00 2001 From: David Chen <530634352@qq.com> Date: Tue, 9 Dec 2025 11:27:54 +0800 Subject: [PATCH 1/3] bugfix Signed-off-by: David Chen <530634352@qq.com> --- .../online_serving/qwen2_5_omni/gradio_demo.py | 16 +++++++++++----- .../online_serving/qwen3_omni/gradio_demo.py | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/examples/online_serving/qwen2_5_omni/gradio_demo.py b/examples/online_serving/qwen2_5_omni/gradio_demo.py index ff77ea2d8a..d21fc7028c 100644 --- a/examples/online_serving/qwen2_5_omni/gradio_demo.py +++ b/examples/online_serving/qwen2_5_omni/gradio_demo.py @@ -94,6 +94,15 @@ def parse_args(): return parser.parse_args() +def build_async_omni_cli_args(base_args: argparse.Namespace) -> argparse.Namespace: + """Construct the minimal CLI args Namespace expected by AsyncOmni.""" + return argparse.Namespace( + model=base_args.model, + stage_configs_path=getattr(base_args, "stage_configs_path", None), + init_timeout=ASYNC_INIT_TIMEOUT, + ) + + def build_sampling_params(seed: int, model_key: str) -> list[SamplingParams]: """Build SamplingParams objects by reusing the dict definitions.""" return [SamplingParams(**params_dict) for params_dict in build_sampling_params_dict(seed, model_key)] @@ -500,11 +509,8 @@ def signal_handler(sig, frame): print(f"Using custom stage configs: {args.stage_configs_path}") sampling_params = build_sampling_params(SEED, model_name) - omni = AsyncOmni( - model=args.model, - stage_configs_path=args.stage_configs_path, - init_timeout=ASYNC_INIT_TIMEOUT, - ) + cli_args = build_async_omni_cli_args(args) + omni = AsyncOmni(model=args.model, cli_args=cli_args) print("✓ AsyncOmni initialized successfully") prompt_args_template = create_prompt_args(args) diff --git a/examples/online_serving/qwen3_omni/gradio_demo.py b/examples/online_serving/qwen3_omni/gradio_demo.py index d246f64493..30afe7904d 100644 --- a/examples/online_serving/qwen3_omni/gradio_demo.py +++ b/examples/online_serving/qwen3_omni/gradio_demo.py @@ -97,6 +97,15 @@ def parse_args(): return parser.parse_args() +def build_async_omni_cli_args(base_args: argparse.Namespace) -> argparse.Namespace: + """Construct the minimal CLI args Namespace expected by AsyncOmni.""" + return argparse.Namespace( + model=base_args.model, + stage_configs_path=getattr(base_args, "stage_configs_path", None), + init_timeout=ASYNC_INIT_TIMEOUT, + ) + + def build_sampling_params(seed: int, model_key: str) -> list[SamplingParams]: """Build SamplingParams objects by reusing the dict definitions.""" return [SamplingParams(**params_dict) for params_dict in build_sampling_params_dict(seed, model_key)] @@ -506,11 +515,8 @@ def signal_handler(sig, frame): print(f"Using custom stage configs: {args.stage_configs_path}") sampling_params = build_sampling_params(SEED, model_name) - omni = AsyncOmni( - model=args.model, - stage_configs_path=args.stage_configs_path, - init_timeout=ASYNC_INIT_TIMEOUT, - ) + cli_args = build_async_omni_cli_args(args) + omni = AsyncOmni(model=args.model, cli_args=cli_args) print("✓ AsyncOmni initialized successfully") prompt_args_template = create_prompt_args(args) From cf6ea4b35f0f7deea6249e781576626f0e3fbf37 Mon Sep 17 00:00:00 2001 From: David Chen <530634352@qq.com> Date: Tue, 9 Dec 2025 11:33:12 +0800 Subject: [PATCH 2/3] bugfix Signed-off-by: David Chen <530634352@qq.com> --- examples/online_serving/qwen2_5_omni/gradio_demo.py | 5 +++++ examples/online_serving/qwen3_omni/gradio_demo.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/examples/online_serving/qwen2_5_omni/gradio_demo.py b/examples/online_serving/qwen2_5_omni/gradio_demo.py index d21fc7028c..39c505b1ac 100644 --- a/examples/online_serving/qwen2_5_omni/gradio_demo.py +++ b/examples/online_serving/qwen2_5_omni/gradio_demo.py @@ -99,6 +99,11 @@ def build_async_omni_cli_args(base_args: argparse.Namespace) -> argparse.Namespa return argparse.Namespace( model=base_args.model, stage_configs_path=getattr(base_args, "stage_configs_path", None), + log_stats=False, + log_file=None, + init_sleep_seconds=0, + shm_threshold_bytes=65536, + batch_timeout=10, init_timeout=ASYNC_INIT_TIMEOUT, ) diff --git a/examples/online_serving/qwen3_omni/gradio_demo.py b/examples/online_serving/qwen3_omni/gradio_demo.py index 30afe7904d..b01cfe03a3 100644 --- a/examples/online_serving/qwen3_omni/gradio_demo.py +++ b/examples/online_serving/qwen3_omni/gradio_demo.py @@ -102,6 +102,11 @@ def build_async_omni_cli_args(base_args: argparse.Namespace) -> argparse.Namespa return argparse.Namespace( model=base_args.model, stage_configs_path=getattr(base_args, "stage_configs_path", None), + log_stats=False, + log_file=None, + init_sleep_seconds=0, + shm_threshold_bytes=65536, + batch_timeout=10, init_timeout=ASYNC_INIT_TIMEOUT, ) From 2f6496db249e467868d2e93324455b2b2294af23 Mon Sep 17 00:00:00 2001 From: David Chen <530634352@qq.com> Date: Tue, 9 Dec 2025 16:17:34 +0800 Subject: [PATCH 3/3] bugfix Signed-off-by: David Chen <530634352@qq.com> --- .../qwen2_5_omni/gradio_demo.py | 47 ++++++++++++++++--- .../online_serving/qwen3_omni/gradio_demo.py | 47 ++++++++++++++++--- 2 files changed, 82 insertions(+), 12 deletions(-) diff --git a/examples/online_serving/qwen2_5_omni/gradio_demo.py b/examples/online_serving/qwen2_5_omni/gradio_demo.py index 39c505b1ac..deacbd9cc7 100644 --- a/examples/online_serving/qwen2_5_omni/gradio_demo.py +++ b/examples/online_serving/qwen2_5_omni/gradio_demo.py @@ -91,6 +91,41 @@ def parse_args(): default=None, help="Path to custom stage configs YAML file (optional).", ) + parser.add_argument( + "--log-stats", + action="store_true", + help="Enable statistics logging for AsyncOmni.", + ) + parser.add_argument( + "--log-file", + type=str, + default=None, + help="Path prefix for AsyncOmni log files.", + ) + parser.add_argument( + "--init-sleep-seconds", + type=int, + default=30, + help="Seconds to sleep between starting stage processes.", + ) + parser.add_argument( + "--shm-threshold-bytes", + type=int, + default=65536, + help="Threshold in bytes for using shared memory IPC.", + ) + parser.add_argument( + "--batch-timeout", + type=int, + default=10, + help="Batching timeout (seconds) inside each stage.", + ) + parser.add_argument( + "--init-timeout", + type=int, + default=ASYNC_INIT_TIMEOUT, + help="Timeout (seconds) for initializing all stages.", + ) return parser.parse_args() @@ -99,12 +134,12 @@ def build_async_omni_cli_args(base_args: argparse.Namespace) -> argparse.Namespa return argparse.Namespace( model=base_args.model, stage_configs_path=getattr(base_args, "stage_configs_path", None), - log_stats=False, - log_file=None, - init_sleep_seconds=0, - shm_threshold_bytes=65536, - batch_timeout=10, - init_timeout=ASYNC_INIT_TIMEOUT, + log_stats=bool(getattr(base_args, "log_stats", False)), + log_file=getattr(base_args, "log_file", None), + init_sleep_seconds=int(getattr(base_args, "init_sleep_seconds", 30)), + shm_threshold_bytes=int(getattr(base_args, "shm_threshold_bytes", 65536)), + batch_timeout=int(getattr(base_args, "batch_timeout", 10)), + init_timeout=int(getattr(base_args, "init_timeout", ASYNC_INIT_TIMEOUT)), ) diff --git a/examples/online_serving/qwen3_omni/gradio_demo.py b/examples/online_serving/qwen3_omni/gradio_demo.py index b01cfe03a3..3286361176 100644 --- a/examples/online_serving/qwen3_omni/gradio_demo.py +++ b/examples/online_serving/qwen3_omni/gradio_demo.py @@ -94,6 +94,41 @@ def parse_args(): default=None, help="Path to custom stage configs YAML file (optional).", ) + parser.add_argument( + "--log-stats", + action="store_true", + help="Enable statistics logging for AsyncOmni.", + ) + parser.add_argument( + "--log-file", + type=str, + default=None, + help="Path prefix for AsyncOmni log files.", + ) + parser.add_argument( + "--init-sleep-seconds", + type=int, + default=30, + help="Seconds to sleep between starting stage processes.", + ) + parser.add_argument( + "--shm-threshold-bytes", + type=int, + default=65536, + help="Threshold in bytes for using shared memory IPC.", + ) + parser.add_argument( + "--batch-timeout", + type=int, + default=10, + help="Batching timeout (seconds) inside each stage.", + ) + parser.add_argument( + "--init-timeout", + type=int, + default=ASYNC_INIT_TIMEOUT, + help="Timeout (seconds) for initializing all stages.", + ) return parser.parse_args() @@ -102,12 +137,12 @@ def build_async_omni_cli_args(base_args: argparse.Namespace) -> argparse.Namespa return argparse.Namespace( model=base_args.model, stage_configs_path=getattr(base_args, "stage_configs_path", None), - log_stats=False, - log_file=None, - init_sleep_seconds=0, - shm_threshold_bytes=65536, - batch_timeout=10, - init_timeout=ASYNC_INIT_TIMEOUT, + log_stats=bool(getattr(base_args, "log_stats", False)), + log_file=getattr(base_args, "log_file", None), + init_sleep_seconds=int(getattr(base_args, "init_sleep_seconds", 30)), + shm_threshold_bytes=int(getattr(base_args, "shm_threshold_bytes", 65536)), + batch_timeout=int(getattr(base_args, "batch_timeout", 10)), + init_timeout=int(getattr(base_args, "init_timeout", ASYNC_INIT_TIMEOUT)), )