Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/paddle/optimizer/adadelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ def _create_accumulators(self, block, parameters):
parameters = parameters.get('params')

for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._add_accumulator(self._avg_squared_grad_acc_str, master_p)
self._add_accumulator(
self._avg_squared_update_acc_str, master_p
)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -169,7 +169,7 @@ def _create_accumulators(self, block, parameters):
)
self._add_accumulator(self._avg_squared_grad_acc_str, p)
self._add_accumulator(self._avg_squared_update_acc_str, p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _append_optimize_op(self, block, param_and_grad):
if isinstance(param_and_grad, dict):
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/optimizer/adagrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _create_accumulators(self, block, parameters):
parameters = self._update_param_group(parameters)

for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
Expand All @@ -151,7 +151,7 @@ def _create_accumulators(self, block, parameters):
master_p,
fill_value=self.initial_accumulator_value,
)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -166,7 +166,7 @@ def _create_accumulators(self, block, parameters):
p,
fill_value=self.initial_accumulator_value,
)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _append_optimize_op(self, block, param_and_grad):
assert isinstance(block, framework.Block)
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/optimizer/adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ def _create_accumulators(self, block, parameters):

# Create accumulator tensors for first and second moments
for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._add_moments_pows(master_p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -286,7 +286,7 @@ def _create_accumulators(self, block, parameters):
"Consider using multi_precision=True option of the Adam optimizer."
)
self._add_moments_pows(p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _append_optimize_op(self, block, param_and_grad):
assert isinstance(block, (framework.Block, paddle.pir.Block))
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/optimizer/adamax.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ def _create_accumulators(self, block, parameters):

# Create accumulator tensors for first moment and infinity norm
for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._add_moments_pows(master_p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -213,7 +213,7 @@ def _create_accumulators(self, block, parameters):
"Consider using multi_precision=True option of the Adam optimizer."
)
self._add_moments_pows(p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _append_optimize_op(self, block, param_and_grad):
assert isinstance(block, framework.Block)
Expand Down
8 changes: 4 additions & 4 deletions python/paddle/optimizer/adamw.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def __init__(
self._use_multi_tensor = None
self.regularization = None
self._auxiliary_vars = {}
self._already_create_accumulater = set()
self._already_create_accumulator = set()

self._create_master_grad_states()

Expand Down Expand Up @@ -400,12 +400,12 @@ def _create_accumulators(self, block, parameters):

# Create accumulator tensors for first and second moments
for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._add_moments_pows(master_p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -416,7 +416,7 @@ def _create_accumulators(self, block, parameters):
"Consider using multi_precision=True option of the Adam optimizer."
)
self._add_moments_pows(p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _append_optimize_op(self, block, param_and_grad):
assert isinstance(block, (framework.Block, pir.Block))
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/optimizer/asgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _create_accumulators(self, block, parameters):
parameters = self._update_param_group(parameters)

for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
p_new = p
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
Expand Down Expand Up @@ -167,7 +167,7 @@ def _create_accumulators(self, block, parameters):
[1],
)

self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _assign_accumulator_master(
self, block, name, param, assign_value, index
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/optimizer/lamb.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ def _create_accumulators(self, block, parameters):

# Create accumulator tensors for first and second moments
for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._add_moments_pows(master_p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
else:
self._add_moments_pows(p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _add_moments_pows(self, p):
acc_dtype = p.dtype
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/optimizer/momentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ def _create_accumulators(self, block, parameters):
parameters = self._update_param_group(parameters)

for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._add_accumulator(self._velocity_acc_str, master_p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -226,7 +226,7 @@ def _create_accumulators(self, block, parameters):
"Consider using multi_precision=True option of the Momentum optimizer."
)
self._add_accumulator(self._velocity_acc_str, p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _create_regularization_of_grad(self, param, grad, regularization=None):
"""Create and add backward regularization Operators
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/optimizer/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def __init__(

self._param_dict = self._create_multi_tensor_dict()
self._auxiliary_vars = {}
self._already_create_accumulater = set()
self._already_create_accumulator = set()

self._master_weights = {}
# create master gradients' states
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/optimizer/rmsprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ def _create_accumulators(self, block, parameters):
parameters = parameters.get('params')

for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue

if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._add_accumulator(self._momentum_acc_str, master_p)
self._add_accumulator(self._mean_square_acc_str, master_p)
self._add_accumulator(self._mean_grad_acc_str, master_p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -225,7 +225,7 @@ def _create_accumulators(self, block, parameters):
self._add_accumulator(self._momentum_acc_str, p)
self._add_accumulator(self._mean_square_acc_str, p)
self._add_accumulator(self._mean_grad_acc_str, p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

def _append_optimize_op(self, block, param_and_grad):
if not isinstance(block, framework.Block):
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/optimizer/rprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _create_accumulators(self, block, parameters):

# Create accumulator tensors for first and second moments
for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
Expand All @@ -165,7 +165,7 @@ def _create_accumulators(self, block, parameters):
p.dtype,
self._initial_learning_rate,
)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand All @@ -187,7 +187,7 @@ def _create_accumulators(self, block, parameters):
p.dtype,
fill_value=self._initial_learning_rate,
)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)

@no_grad
def _append_optimize_op(self, block, param_and_grad):
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/optimizer/sgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ def _create_accumulators(self, block, parameters):

# Create accumulator tensors for first and second moments
for p in parameters:
if p.name in self._already_create_accumulater:
if p.name in self._already_create_accumulator:
continue
if self._multi_precision and self._is_dtype_fp16_or_bf16(p.dtype):
master_p = self._create_master_weight(p)
self._already_create_accumulater.add(p.name)
self._already_create_accumulator.add(p.name)
continue
if (
self._is_dtype_fp16_or_bf16(p.dtype)
Expand Down