Skip to content

Commit ca1828c

Browse files
Reset scaling.json files when evaluating RCPs (#432)
1 parent ed4e6d5 commit ca1828c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mlperf_logging/rcp_checker/rcp_checker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ def _set_results_scaling(self, scale_factor, results_dir):
439439
with open(filepath, "w") as scaling_file:
440440
scaling_file.write(json_content)
441441

442+
def _reset_results_scaling(self, results_dir):
443+
filepath = results_dir+'/scaling.json'
444+
if os.path.exists(filepath):
445+
os.remove(filepath)
446+
442447
def _eval_submission_record(self, rcp_record, subm_epochs, results_dir):
443448
'''Compare reference and submission convergence.'''
444449

@@ -449,6 +454,7 @@ def _eval_submission_record(self, rcp_record, subm_epochs, results_dir):
449454
samples_rejected = 4 if rcp_record["Benchmark"] == 'unet3d' else 1
450455
mean_subm_epochs = np.mean(subm_epochs[samples_rejected:len(subm_epochs)-samples_rejected])
451456
norm_factor = self._find_norm_factor(rcp_record, mean_subm_epochs)
457+
self._reset_results_scaling(results_dir)
452458
if mean_subm_epochs >= (rcp_record["RCP Mean"] / rcp_record["Max Speedup"]):
453459
logging.info(" RCP Record: %s", rcp_record)
454460
logging.info(" Submission mean epochs: %.4f", mean_subm_epochs)

0 commit comments

Comments
 (0)