Skip to content

Commit 8a3c791

Browse files
committed
Fix
1 parent bcefbaf commit 8a3c791

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

python/paddle/decomposition/decomp.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ def decompose(
228228

229229
if not isinstance(blacklist, (set, frozenset)):
230230
raise TypeError(
231-
f'Expected type of blacklisst is set|frozenset, but got {type(blacklist)}.'
231+
f'Expected type of blacklist is set|frozenset, but got {type(blacklist)}.'
232232
)
233233
if not isinstance(whitelist, (set, frozenset)):
234234
raise TypeError(
235-
f'Expected type of whiltelist is set|frozenset, but got {type(whitelist)}.'
235+
f'Expected type of whitelist is set|frozenset, but got {type(whitelist)}.'
236236
)
237237

238238
blacklist = core.prim_config["forward_blacklist"] | blacklist
@@ -288,7 +288,7 @@ def decompose(
288288

289289
def _decompose_subgraph(block, orig_vars, dst_vars, op_filter):
290290
"""
291-
The operators in block wich satisfy the filter conditon will be decomposed into primitives.
291+
The operators in block which satisfy the filter condition will be decomposed into primitives.
292292
293293
Args:
294294
block (Block|Sequence[Block]): The blocks of program to be processed.
@@ -689,7 +689,7 @@ def _decomp_bwd_with_vjp(
689689
grad_var_to_var, orig_grads=bwd_op.results(), new_grads=res
690690
)
691691

692-
# step5: replace original backward op with new primiive ops
692+
# step5: replace original backward op with new primitive ops
693693
insert_idx = bwd_op_idx
694694
for i in range(before_num_ops, after_num_ops):
695695
block.move_op(block.ops[i], insert_idx)
@@ -759,7 +759,7 @@ def _decomp_bwd_without_vjp(
759759
grad_var_to_var, orig_grads=grad_inputs, new_grads=res
760760
)
761761

762-
# step5: replace original backward op with new primiive ops
762+
# step5: replace original backward op with new primitive ops
763763
insert_idx = bwd_op_idx
764764
for i in range(before_num_ops, after_num_ops):
765765
block.move_op(block.ops[i], insert_idx)
@@ -957,7 +957,7 @@ def _decomp_fwd_program(pir_program, pir_grad_var_to_var):
957957
with paddle.pir.core.program_guard(pir_program):
958958
ops = pir_program.global_block().ops
959959
bwd_ops = _get_all_bwd_ops(pir_program)
960-
# ops including compile-time infermeta, causing mismatched input shape and output shape, which is unsupported when decompoing.
960+
# ops including compile-time infermeta, causing mismatched input shape and output shape, which is unsupported when decomposing.
961961
black_fwd_ops = ["pd_op.stack", "pd_op.squeeze"]
962962
undecomposed_fwd_ops = []
963963

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)