From 8f40aceb3e23d949bbece27bb6dc9404dcc872c6 Mon Sep 17 00:00:00 2001 From: badaoui Date: Wed, 19 Nov 2025 11:32:11 +0000 Subject: [PATCH] fix validation checks order --- benchmark_v2/framework/benchmark_config.py | 2 ++ benchmark_v2/run_benchmarks.py | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/benchmark_v2/framework/benchmark_config.py b/benchmark_v2/framework/benchmark_config.py index fe68d764a5f7..34f08f525893 100644 --- a/benchmark_v2/framework/benchmark_config.py +++ b/benchmark_v2/framework/benchmark_config.py @@ -203,6 +203,8 @@ def adapt_configs( config["sequence_length"] = seqlen config["num_tokens_to_generate"] = ntok config["gpu_monitoring"] = monitor + # Remove the old name so it gets re-inferred with the updated values + config.pop("name", None) adapted_configs.append(BenchmarkConfig.from_dict(config)) return adapted_configs diff --git a/benchmark_v2/run_benchmarks.py b/benchmark_v2/run_benchmarks.py index 08ed0e60c2b3..e4373812c715 100755 --- a/benchmark_v2/run_benchmarks.py +++ b/benchmark_v2/run_benchmarks.py @@ -80,16 +80,16 @@ logger.info(f"Benchmark run UUID: {benchmark_run_uuid}") logger.info(f"Output directory: {args.output_dir}") - # We cannot compute ITL if we don't have at least two measurements - if any(n <= 1 for n in args.num_tokens_to_generate): - raise ValueError("--num_tokens_to_generate arguments should be larger than 1") - # Error out if one of the arguments is not provided - if len(args.batch_size) * len(args.sequence_length) * len(args.num_tokens_to_generate) == 0: + if any(arg is None for arg in [args.batch_size, args.sequence_length, args.num_tokens_to_generate]): raise ValueError( - "At least one of the arguments --batch-size, --sequence-length, or --num-tokens-to-generate is required" + "All of the arguments --batch-size, --sequence-length, and --num-tokens-to-generate are required" ) + # We cannot compute ITL if we don't have at least two measurements + if any(n <= 1 for n in args.num_tokens_to_generate): + raise ValueError("--num_tokens_to_generate arguments should be larger than 1") + # Get the configs for the given coverage level configs = get_config_by_level(args.level) # Adapt the configs to the given arguments