5050from madengine .core .constants import MODEL_DIR , PUBLIC_GITHUB_ROCM_KEY
5151from madengine .core .timeout import Timeout
5252from madengine .tools .update_perf_csv import update_perf_csv
53- from madengine .tools .update_perf_super import update_perf_super_json
5453from madengine .tools .csv_to_html import convert_csv_to_html
5554from madengine .tools .discover_models import DiscoverModels
56- from madengine .utils .config_parser import ConfigParser
5755
5856
5957class RunDetails :
@@ -85,7 +83,6 @@ class RunDetails:
8583 data_download_duration (str): The duration of data download.
8684 build_number (str): The CI build number.
8785 additional_docker_run_options (str): The additional options used for docker run.
88- configs (dict or list or None): The configuration data from config files.
8986 """
9087
9188 # Avoiding @property for ease of code, add if needed.
@@ -115,7 +112,6 @@ def __init__(self):
115112 self .data_download_duration = ""
116113 self .build_number = ""
117114 self .additional_docker_run_options = ""
118- self .configs = None
119115
120116 def print_perf (self ):
121117 """Print the performance results of a model.
@@ -130,30 +126,6 @@ def print_perf(self):
130126 def generate_json (self , json_name : str , multiple_results : bool = False ) -> None :
131127 """Generate JSON file for performance results of a model.
132128
133- Args:
134- json_name (str): The name of the JSON file.
135- multiple_results (bool): The status of multiple results. Default is False.
136-
137- Raises:
138- Exception: An error occurred while generating JSON file for performance results of a model.
139- """
140- # Exclude configs from CSV workflow as it can contain list/dict values
141- # that cause issues with pandas DataFrame creation
142- keys_to_exclude = (
143- {"model" , "performance" , "metric" , "status" , "configs" } if multiple_results
144- else {"configs" }
145- )
146- attributes = vars (self )
147- output_dict = {x : attributes [x ] for x in attributes if x not in keys_to_exclude }
148- with open (json_name , "w" ) as outfile :
149- json .dump (output_dict , outfile )
150-
151- def generate_super_json (self , json_name : str , multiple_results : bool = False ) -> None :
152- """Generate enhanced JSON file with config data for performance results.
153-
154- This method is similar to generate_json but includes the configs field
155- for perf_entry_super.json generation.
156-
157129 Args:
158130 json_name (str): The name of the JSON file.
159131 multiple_results (bool): The status of multiple results. Default is False.
@@ -167,7 +139,7 @@ def generate_super_json(self, json_name: str, multiple_results: bool = False) ->
167139 attributes = vars (self )
168140 output_dict = {x : attributes [x ] for x in attributes if x not in keys_to_exclude }
169141 with open (json_name , "w" ) as outfile :
170- json .dump (output_dict , outfile , indent = 2 )
142+ json .dump (output_dict , outfile )
171143
172144
173145class RunModels :
@@ -1006,17 +978,6 @@ def run_model(self, model_info: typing.Dict) -> bool:
1006978 # Taking gpu arch from context assumes the host image and container have the same gpu arch.
1007979 # Environment variable updates for MAD Public CI
1008980 run_details .gpu_architecture = self .context .ctx ["docker_env_vars" ]["MAD_SYSTEM_GPU_ARCHITECTURE" ]
1009-
1010- # Parse and load config file if present in args for perf_entry_super.json
1011- try :
1012- config_parser = ConfigParser (scripts_base_dir = os .path .dirname (model_info .get ("scripts" , "" )))
1013- run_details .configs = config_parser .parse_and_load (
1014- model_info ["args" ],
1015- model_info .get ("scripts" , "" )
1016- )
1017- except Exception as e :
1018- print (f"Warning: Could not parse config file: { e } " )
1019- run_details .configs = None
1020981
1021982 # Check the setting of shared memory size
1022983 if "SHM_SIZE" in self .context .ctx :
@@ -1057,14 +1018,6 @@ def run_model(self, model_info: typing.Dict) -> bool:
10571018 # generate exception for testing
10581019 run_details .generate_json ("perf_entry.json" )
10591020 update_perf_csv (exception_result = "perf_entry.json" , perf_csv = self .args .output )
1060-
1061- # Generate perf_entry_super.json
1062- run_details .generate_super_json ("perf_entry_super.json" )
1063- update_perf_super_json (
1064- exception_result = "perf_entry_super.json" ,
1065- perf_super_json = "perf_entry_super.json" ,
1066- scripts_base_dir = os .path .dirname (model_info .get ("scripts" , "" )),
1067- )
10681021 else :
10691022 print (
10701023 f"Running model { run_details .model } on { run_details .gpu_architecture } architecture."
@@ -1166,30 +1119,12 @@ def run_model(self, model_info: typing.Dict) -> bool:
11661119 model_name = run_details .model ,
11671120 common_info = "common_info.json" ,
11681121 )
1169-
1170- # Generate perf_entry_super.json
1171- run_details .generate_super_json ("common_info_super.json" , multiple_results = True )
1172- update_perf_super_json (
1173- multiple_results = model_info ['multiple_results' ],
1174- perf_super_json = "perf_entry_super.json" ,
1175- model_name = run_details .model ,
1176- common_info = "common_info_super.json" ,
1177- scripts_base_dir = os .path .dirname (model_info .get ("scripts" , "" )),
1178- )
11791122 else :
11801123 run_details .generate_json ("perf_entry.json" )
11811124 update_perf_csv (
11821125 single_result = "perf_entry.json" ,
11831126 perf_csv = self .args .output ,
11841127 )
1185-
1186- # Generate perf_entry_super.json
1187- run_details .generate_super_json ("perf_entry_super.json" )
1188- update_perf_super_json (
1189- single_result = "perf_entry_super.json" ,
1190- perf_super_json = "perf_entry_super.json" ,
1191- scripts_base_dir = os .path .dirname (model_info .get ("scripts" , "" )),
1192- )
11931128
11941129 self .return_status &= (run_details .status == 'SUCCESS' )
11951130
@@ -1206,14 +1141,6 @@ def run_model(self, model_info: typing.Dict) -> bool:
12061141 exception_result = "perf_entry.json" ,
12071142 perf_csv = self .args .output ,
12081143 )
1209-
1210- # Generate perf_entry_super.json
1211- run_details .generate_super_json ("perf_entry_super.json" )
1212- update_perf_super_json (
1213- exception_result = "perf_entry_super.json" ,
1214- perf_super_json = "perf_entry_super.json" ,
1215- scripts_base_dir = os .path .dirname (model_info .get ("scripts" , "" )),
1216- )
12171144
12181145 except Exception as e :
12191146 self .return_status = False
@@ -1228,14 +1155,6 @@ def run_model(self, model_info: typing.Dict) -> bool:
12281155 exception_result = "perf_entry.json" ,
12291156 perf_csv = self .args .output ,
12301157 )
1231-
1232- # Generate perf_entry_super.json
1233- run_details .generate_super_json ("perf_entry_super.json" )
1234- update_perf_super_json (
1235- exception_result = "perf_entry_super.json" ,
1236- perf_super_json = "perf_entry_super.json" ,
1237- scripts_base_dir = os .path .dirname (model_info .get ("scripts" , "" )),
1238- )
12391158
12401159 return self .return_status
12411160
0 commit comments