From 4e20fd32db1e817710778a5f90458e0e70af89db Mon Sep 17 00:00:00 2001 From: functionstackx <47992694+functionstackx@users.noreply.github.com> Date: Tue, 29 Sep 2026 01:27:33 +0000 Subject: [PATCH] test: consolidate redundant e2e matrix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 合并端到端矩阵生成的重复测试,保留实验名称、上下文长度、并发列表及筛选行为的覆盖。 --- .../matrix/test_generate_sweep_configs.py | 66 +++---------------- 1 file changed, 10 insertions(+), 56 deletions(-) diff --git a/inferencex-e2e/infx/tests/matrix/test_generate_sweep_configs.py b/inferencex-e2e/infx/tests/matrix/test_generate_sweep_configs.py index a23ac34788..439dccb870 100644 --- a/inferencex-e2e/infx/tests/matrix/test_generate_sweep_configs.py +++ b/inferencex-e2e/infx/tests/matrix/test_generate_sweep_configs.py @@ -1068,9 +1068,15 @@ def test_sweep_expands_each_sequence_length_across_concurrencies(self, sample_si sample_single_node_config, sample_runner_config ) - assert [(row["isl"], row["osl"], row["conc"]) for row in result] == [ - (isl, osl, conc) - for isl, osl in [(1024, 1024), (8192, 1024)] + assert [ + (row["isl"], row["osl"], row["conc"], row["exp-name"], row["max-model-len"]) + for row in result + ] == [ + (isl, osl, conc, name, context) + for isl, osl, name, context in [ + (1024, 1024, "dsr1_1k1k", 2304), + (8192, 1024, "dsr1_8k1k", 9472), + ] for conc in [4, 8, 16, 32, 64] ] @@ -1305,27 +1311,6 @@ def test_step_size(self, sample_single_node_config, sample_runner_config, full_s assert 16 in conc_values assert 64 in conc_values - def test_exp_name_format(self, sample_single_node_config, sample_runner_config, full_sweep_args_single_node): - full_sweep_args_single_node.seq_lens = ["1k1k"] - result = generate_full_sweep( - full_sweep_args_single_node, - sample_single_node_config, - sample_runner_config - ) - assert all(entry["exp-name"] == "dsr1_1k1k" for entry in result) - - def test_max_model_len_calculation(self, sample_single_node_config, sample_runner_config, full_sweep_args_single_node): - """max-model-len should be isl + osl + 256.""" - result = generate_full_sweep( - full_sweep_args_single_node, - sample_single_node_config, - sample_runner_config - ) - assert { - (entry["isl"], entry["osl"], entry["max-model-len"]) - for entry in result - } == {(1024, 1024, 2304), (8192, 1024, 9472)} - def test_runner_node_filter(self, sample_single_node_config, sample_runner_config, full_sweep_args_single_node): """Runner node filter should expand entries to individual matching nodes.""" full_sweep_args_single_node.runner_type = ["mi300x"] @@ -1353,20 +1338,6 @@ def test_runner_node_filter_no_match(self, sample_single_node_config, sample_run ) assert len(result) == 0 - def test_runner_node_filter_without_runner_type(self, sample_single_node_config, sample_runner_config, full_sweep_args_single_node): - """Runner node filter should work without explicit runner type (uses config's runner).""" - full_sweep_args_single_node.runner_node_filter = "amd" - full_sweep_args_single_node.seq_lens = ["1k1k"] - full_sweep_args_single_node.max_conc = 4 - result = generate_full_sweep( - full_sweep_args_single_node, - sample_single_node_config, - sample_runner_config - ) - # Config has runner=mi300x, filter "amd" matches mi300x-amd_0 and mi300x-amd_1 - assert len(result) == 2 - assert all("amd" in entry["runner"] for entry in result) - class TestGenerateFullSweepMultiNode: @@ -1379,6 +1350,7 @@ def test_multinode_entry_structure(self, sample_multinode_config, sample_runner_ sample_runner_config ) entry = result[0] + assert entry["conc"] == [2150] assert entry["prefill"]["num-worker"] == 5 assert entry["decode"]["num-worker"] == 1 assert entry["disagg"] is True @@ -1418,24 +1390,6 @@ def test_multinode_parallelism_fields(self, sample_multinode_config, sample_runn entry["decode"]["pcp-size"], ) == (2, 4, 1) - def test_multinode_conc_as_list(self, sample_multinode_config, sample_runner_config, full_sweep_args_multi_node): - """Multinode conc should be passed as list.""" - result = generate_full_sweep( - full_sweep_args_multi_node, - sample_multinode_config, - sample_runner_config - ) - entry = result[0] - assert entry["conc"] == [2150] - - def test_single_node_flag_skips_multinode(self, sample_multinode_config, sample_runner_config, full_sweep_args_single_node): - result = generate_full_sweep( - full_sweep_args_single_node, - sample_multinode_config, - sample_runner_config - ) - assert len(result) == 0 - def test_runner_node_filter_multinode(self, sample_runner_config, full_sweep_args_multi_node): # Create a multinode config with h200 runner (which has 4 nodes) config = {