From 18bf1c6ed8be1c6bc4fc869a8be3a7e4761c2e2c Mon Sep 17 00:00:00 2001 From: Aryan Putta Date: Sun, 19 Apr 2026 18:52:25 -0400 Subject: [PATCH] fix: remove dead import and redundant entry dicts in generate_sweep_configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two dead code issues in generate_full_sweep(): 1. `from ast import For` at the top of the file — For is an AST node class that is never referenced anywhere in this module. Left over from an earlier draft. 2. In both the multinode and single-node branches, an `entry` dict was built and immediately discarded because it was unconditionally overwritten by an identical dict inside the `for runner_value` loop. Removed the outer construction and hoisted the `runners_for_entry` and `seq_len_str` assignments above the loop where they belong. Signed-off-by: Aryan Putta --- utils/matrix_logic/generate_sweep_configs.py | 47 ++------------------ 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/utils/matrix_logic/generate_sweep_configs.py b/utils/matrix_logic/generate_sweep_configs.py index a95de595b..23be07388 100644 --- a/utils/matrix_logic/generate_sweep_configs.py +++ b/utils/matrix_logic/generate_sweep_configs.py @@ -1,4 +1,3 @@ -from ast import For import fnmatch import json import argparse @@ -265,26 +264,7 @@ def generate_full_sweep(args, all_config_data, runner_data): else: conc_values = filtered_conc - # For multinode, create a single entry with conc as a list seq_len_str = seq_len_to_str(isl, osl) - entry = { - Fields.IMAGE.value: image, - Fields.MODEL.value: model, - Fields.MODEL_PREFIX.value: model_code, - Fields.PRECISION.value: precision, - Fields.FRAMEWORK.value: framework, - Fields.RUNNER.value: runner, - Fields.ISL.value: isl, - Fields.OSL.value: osl, - Fields.SPEC_DECODING.value: spec_decoding, - Fields.PREFILL.value: prefill, - Fields.DECODE.value: decode, - Fields.CONC.value: conc_values, # Pass the entire list for multinode - Fields.MAX_MODEL_LEN.value: isl + osl + 200, - Fields.EXP_NAME.value: f"{model_code}_{seq_len_str}", - Fields.DISAGG.value: disagg, - Fields.RUN_EVAL.value: False, # Default, may be overridden by mark_eval_entries - } # Determine which runner(s) to use runners_for_entry = runner_nodes_to_use if runner_nodes_to_use else [runner] @@ -355,32 +335,11 @@ def generate_full_sweep(args, all_config_data, runner_data): else: conc_end = min(conc_end, args.max_conc) + seq_len_str = seq_len_to_str(isl, osl) + runners_for_entry = runner_nodes_to_use if runner_nodes_to_use else [runner] + conc = conc_start while conc <= conc_end: - seq_len_str = seq_len_to_str(isl, osl) - entry = { - Fields.IMAGE.value: image, - Fields.MODEL.value: model, - Fields.MODEL_PREFIX.value: model_code, - Fields.PRECISION.value: precision, - Fields.FRAMEWORK.value: framework, - Fields.RUNNER.value: runner, - Fields.ISL.value: isl, - Fields.OSL.value: osl, - Fields.TP.value: tp, - Fields.CONC.value: conc, - Fields.MAX_MODEL_LEN.value: isl + osl + 200, - Fields.EP.value: 1, # Default - Fields.DP_ATTN.value: False, # Default - Fields.SPEC_DECODING.value: spec_decoding, - Fields.EXP_NAME.value: f"{model_code}_{seq_len_str}", - Fields.DISAGG.value: disagg, - Fields.RUN_EVAL.value: False, # Default, may be overridden by mark_eval_entries - } - - # Determine which runner(s) to use - runners_for_entry = runner_nodes_to_use if runner_nodes_to_use else [runner] - for runner_value in runners_for_entry: entry = { Fields.IMAGE.value: image,