From 9a1ca59cc06b0d372ed65a902ecd2986ca1ae5a3 Mon Sep 17 00:00:00 2001 From: Akshat Tripathi Date: Fri, 5 Jul 2024 15:21:31 +0000 Subject: [PATCH] Fixed bug where SUTs with 2**n devices were treated as SUTs with 2**(n-1) devices --- base_sut/code_axs.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/base_sut/code_axs.py b/base_sut/code_axs.py index 1825c92..d3c0a9a 100644 --- a/base_sut/code_axs.py +++ b/base_sut/code_axs.py @@ -92,7 +92,10 @@ def merge(sut, model, model_config_entry, model_compiletime_device_model_entry, """ data_dict = {} data_dict.update(runtime_device_model_entry.get("scenario_independent_runtime_config")) - data_dict.update(runtime_device_model_entry.get(loadgen_scenario)) + scenario_dependent_runtime_config = runtime_device_model_entry.get(loadgen_scenario) + if scenario_dependent_runtime_config is None: + raise ValueError(f"Expected runtime entry to have config related to {loadgen_scenario}") + data_dict.update(scenario_dependent_runtime_config) try: data_dict.update(override_runtime_config[model][loadgen_scenario]) @@ -244,22 +247,13 @@ def _parse_device_id(num_device, text=None, delimiter="+" ): return text def set_hypothetical_num_device(num_device): - """Dyson has 5 card, but only 4 card setting is required, especially for MultiStream. + """Sometimes we need a power of 2 number of cards, this function rounds down to them """ - print(num_device) - print(num_device) - print(num_device) - print(num_device) - print(num_device) - print(num_device) MAX_SUPPORTED_NUM_DEVICE = 64 assert num_device <= MAX_SUPPORTED_NUM_DEVICE, f"\n\n\nError: Supported up to {MAX_SUPPORTED_NUM_DEVICE} but the System-Under-Test has [{num_device}] cards.\n\n\n" - if num_device == 1: - return 1 - else: - return 2 ** int(math.log2(num_device - 1)) + return 2 ** int(math.log2(num_device)) def get_model_config(model, device, __entry__=None): query = f"model_config,model={model},device={device}"