@@ -88,20 +88,20 @@ def get_metric(results):
8888 assert isinstance (
8989 results , dict
9090 ), f"results should be type of dictionary, but got { type (results )} ."
91- if 'Throughtput ' in results and isinstance (results ['Throughtput ' ], float ):
92- return float (results ['Throughtput ' ])
91+ if 'Throughput ' in results and isinstance (results ['Throughput ' ], float ):
92+ return float (results ['Throughput ' ])
9393 else :
9494 return - 1.0
9595
9696
9797def parse_results (results ):
98- if results ['Throughtput ' ] > 0 :
99- return "Throughtput : {} step / s." .format (results ['Throughtput ' ])
98+ if results ['Throughput ' ] > 0 :
99+ return "Throughput : {} step / s." .format (results ['Throughput ' ])
100100 et = results .get ("ErrorType" , None )
101101 if et == "ResourceExhaustedError" :
102102 return "Fail with OOM"
103103 else :
104- return "Fail with UNKWON ERROR"
104+ return "Fail with UNKNOWN ERROR"
105105
106106
107107# TODO only dependent on dist context
@@ -241,7 +241,7 @@ def rank(self):
241241 def device_id (self ):
242242 return paddle .distributed .ParallelEnv ().device_id
243243
244- # TODO Generate compelet program with all parts like forward, backward, update
244+ # TODO Generate complete program with all parts like forward, backward, update
245245 # as well as parallelism transformation.
246246 def _build_programs_without_optimization (self ):
247247 serial_main_program = self ._baseline_dist_context .serial_main_program
@@ -512,7 +512,7 @@ def _profile_trial(self, trial):
512512 results = json .load (fp )
513513 return results
514514 except FileNotFoundError :
515- Error_results = {"Throughtput " : - 1 , "ErrorType" : 'FatalError' }
515+ Error_results = {"Throughput " : - 1 , "ErrorType" : 'FatalError' }
516516 return Error_results
517517
518518 def _evaluate_trial (self , trial ):
@@ -539,9 +539,9 @@ def _evaluate_trial(self, trial):
539539 def _update (self , i , trial , results ):
540540 self ._finished_trials .append (trial )
541541
542- cur_mertic = get_metric (results )
543- if self ._best_metric is None or cur_mertic > self ._best_metric :
544- self ._best_metric = cur_mertic
542+ cur_metric = get_metric (results )
543+ if self ._best_metric is None or cur_metric > self ._best_metric :
544+ self ._best_metric = cur_metric
545545 self ._best_iter = i
546546
547547 def _get_trial_dir (self , trial ):
0 commit comments