Skip to content

Commit 7038529

Browse files
committed
Fix
1 parent 30a22b8 commit 7038529

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

python/paddle/distributed/auto_parallel/static/tuner/optimization_tuner.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

9797
def 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):

python/paddle/distributed/auto_parallel/static/tuner/profiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def profiler(args):
258258
)
259259

260260
result_dict = {
261-
"Throughtput": avg_tput,
261+
"Throughput": avg_tput,
262262
"ErrorType": None,
263263
}
264264

@@ -274,7 +274,7 @@ def profiler(args):
274274
except Exception as e:
275275
error_type = get_cpp_error_type(e)
276276
result_dict = {
277-
"Throughtput": -1,
277+
"Throughput": -1,
278278
"ErrorType": error_type,
279279
}
280280
if not os.path.isfile(result_path):

0 commit comments

Comments
 (0)