Skip to content

Commit

Permalink
Fixed bug where SUTs with 2**n devices were treated as SUTs with 2**(…
Browse files Browse the repository at this point in the history
…n-1) devices
  • Loading branch information
Akshat-Tripathi authored and psyhtest committed Jul 5, 2024
1 parent 04cfd83 commit 9a1ca59
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions base_sut/code_axs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 9a1ca59

Please sign in to comment.