Skip to content

Commit

Permalink
[CodeStyle][Typos][G-[1-5]] Fix typos(guassian, gloabl, graident, gra…
Browse files Browse the repository at this point in the history
…mmer, grpah) (#70460)
  • Loading branch information
enkilee authored Dec 26, 2024
1 parent 6d06677 commit ce5accc
Show file tree
Hide file tree
Showing 37 changed files with 50 additions and 55 deletions.
5 changes: 0 additions & 5 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ funcion = 'funcion'
Funcion = 'Funcion'
futher = 'futher'
furture = 'furture'
guassian = 'guassian'
gloabl = 'gloabl'
graident = 'graident'
grammer = 'grammer'
grpah = 'grpah'
Greate = 'Greate'
groupped = 'groupped'
gard = 'gard'
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/gpu/lars_momentum_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ __global__ void L2NormKernel(
g_buffer[blockIdx.x] = g_tmp;
}
#if CUDA_VERSION >= 11000
cg->sync(); // Grid sync for writring partial result to gloabl memory
cg->sync(); // Grid sync for writring partial result to global memory
MT p_part_sum = threadIdx.x < gridDim.x ? p_buffer[threadIdx.x] : 0;
MT g_part_sum = threadIdx.x < gridDim.x ? g_buffer[threadIdx.x] : 0;
MT tmp0 = phi::funcs::BlockReduceSum<MT>(p_part_sum, FINAL_MASK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _create_job_list(self):

assert num_micro_batches % pp_degree == 0

# TODO(luchang): Fix the graident explosion issue when num_model_chunks(accumulate steps) > pp_degree
# TODO(luchang): Fix the gradient explosion issue when num_model_chunks(accumulate steps) > pp_degree
assert (
num_micro_batches <= pp_degree
), "zbvpp now only supports accumulate steps <= pp degree. It will cause gradient exploitation when accumulate steps > pp degree."
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/jit/dy2static/program_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ def __init__(self):
self._recent_cache_key = None

def _build_once(self, cache_key):
# TODO(Aurelius84): Need a gloabl FLAGS to enable/disable to_prim
# TODO(Aurelius84): Need a global FLAGS to enable/disable to_prim
enable_prim = cache_key.kwargs['build_strategy'].build_cinn_pass

if use_pir_api():
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/nn/initializer/normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def forward(
"complex64",
"complex128",
],
"guassian_random",
"gaussian_random",
)

if self._seed == 0:
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/pir/core/program_translator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ TEST(OperatorDialectTest, StartupProgram) {
size_t op_size = program->block()->size();
// ops.size() = op size in BlockDesc + parameter_op +
// consant_op_for_uniform
// + consant_op for guassian
// + consant_op for gaussian
EXPECT_EQ(op_size, p.Block(0).OpSize() + program->parameters_num() + 3 + 53);

std::stringstream ss;
Expand Down
4 changes: 2 additions & 2 deletions test/dygraph_to_static/test_seq2seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def train(args, attn_model=False):
)
)

gloabl_norm_clip = ClipGradByGlobalNorm(args.max_grad_norm)
global_norm_clip = ClipGradByGlobalNorm(args.max_grad_norm)
optimizer = paddle.optimizer.SGD(
args.learning_rate,
parameters=model.parameters(),
grad_clip=gloabl_norm_clip,
grad_clip=global_norm_clip,
)

model.train()
Expand Down
12 changes: 6 additions & 6 deletions test/indexing/test_setitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def test_combined_indexing_and_value_is_tensor_3(self):
np.testing.assert_allclose(x.numpy(), np_data)

def test_inplace_with_stride_bwd_1(self):
# combined-setitem case for X with stop_graident=False
# combined-setitem case for X with stop_gradient=False
np_v = np.random.randn(3, 1).astype(self.ndtype)
if self.dtype == 'bfloat16':
np_v = convert_uint16_to_float(convert_float_to_uint16(np_v))
Expand Down Expand Up @@ -374,7 +374,7 @@ def test_inplace_with_stride_bwd_1(self):
np.testing.assert_equal(v.grad.numpy(), expected_v_grad)

def test_inplace_with_stride_bwd_2(self):
# combined-setitem case for X with stop_graident=True
# combined-setitem case for X with stop_gradient=True
np_v = np.random.randn(3, 1).astype(self.ndtype)
if self.dtype == 'bfloat16':
np_v = convert_uint16_to_float(convert_float_to_uint16(np_v))
Expand Down Expand Up @@ -406,7 +406,7 @@ def test_inplace_with_stride_bwd_2(self):
np.testing.assert_equal(v.grad.numpy(), expected_v_grad)

def test_inplace_with_stride_bwd_3(self):
# advanced-setitem case for X with stop_graident=False
# advanced-setitem case for X with stop_gradient=False
np_v = np.random.randn(3, 3, 1).astype(self.ndtype)
if self.dtype == 'bfloat16':
np_v = convert_uint16_to_float(convert_float_to_uint16(np_v))
Expand Down Expand Up @@ -438,7 +438,7 @@ def test_inplace_with_stride_bwd_3(self):
np.testing.assert_equal(v.grad.numpy(), expected_v_grad)

def test_inplace_with_stride_bwd_4(self):
# advanced-setitem case for X with stop_graident=True
# advanced-setitem case for X with stop_gradient=True
np_v = np.random.randn(3, 3, 1).astype(self.ndtype)
if self.dtype == 'bfloat16':
np_v = convert_uint16_to_float(convert_float_to_uint16(np_v))
Expand Down Expand Up @@ -470,7 +470,7 @@ def test_inplace_with_stride_bwd_4(self):
np.testing.assert_equal(v.grad.numpy(), expected_v_grad)

def test_basic_setitem_bwd_1(self):
# basic-setitem case for X with stop_graident=False
# basic-setitem case for X with stop_gradient=False
np_v = np.random.randn(5).astype(self.ndtype)
if self.dtype == 'bfloat16':
np_v = convert_uint16_to_float(convert_float_to_uint16(np_v))
Expand Down Expand Up @@ -502,7 +502,7 @@ def test_basic_setitem_bwd_1(self):
np.testing.assert_equal(v.grad.numpy(), expected_v_grad)

def test_basic_setitem_bwd_2(self):
# basic-setitem case for X with stop_graident=True
# basic-setitem case for X with stop_gradient=True
np_v = np.random.randn(5).astype(self.ndtype)
if self.dtype == 'bfloat16':
np_v = convert_uint16_to_float(convert_float_to_uint16(np_v))
Expand Down
2 changes: 1 addition & 1 deletion test/ir/pir/cinn/symbolic/test_sub_graph_batch_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.conv.conv2d||method:transpose||method:flatten||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||method:reshape||method:transpose||method:reshape||method:transpose||method:reshape||method:transpose||api:paddle.tensor.linalg.matmul||method:__mul__||api:paddle.nn.functional.activation.softmax||api:paddle.tensor.linalg.matmul||method:transpose||method:reshape||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.dropout||method:__truediv__||method:__add__||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||method:reshape||method:transpose||method:reshape||method:transpose||method:reshape||method:transpose||api:paddle.tensor.linalg.matmul||method:__mul__||api:paddle.nn.functional.activation.softmax||api:paddle.tensor.linalg.matmul||method:transpose||method:reshape||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.dropout||method:__truediv__||method:__add__||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||method:chunk||api:paddle.nn.functional.activation.gelu||method:__mul__||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.common.linear||method:__add__||method:reshape||method:transpose||api:paddle.nn.functional.conv.conv2d||method:__add__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# method:cast||api:paddle.tensor.attribute.shape||method:__getitem__||method:__getitem__||method:__getitem__||method:__getitem__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.conv.conv2d||method:transpose||method:flatten||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||method:reshape||method:transpose||method:reshape||method:transpose||method:reshape||method:transpose||api:paddle.tensor.linalg.matmul||method:__mul__||api:paddle.nn.functional.activation.softmax||api:paddle.tensor.linalg.matmul||method:transpose||method:reshape||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.dropout||method:__truediv__||method:__add__||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||method:reshape||method:transpose||method:reshape||method:transpose||method:reshape||method:transpose||api:paddle.tensor.linalg.matmul||method:__mul__||api:paddle.nn.functional.activation.softmax||api:paddle.tensor.linalg.matmul||method:transpose||method:reshape||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.dropout||method:__truediv__||method:__add__||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||method:chunk||api:paddle.nn.functional.activation.gelu||method:__mul__||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.common.linear||method:__add__||method:reshape||method:transpose||api:paddle.nn.functional.conv.conv2d||method:__add__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.linear||method:__getitem__||method:__add__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# method:cast||api:paddle.tensor.attribute.shape||method:__getitem__||method:__getitem__||method:__getitem__||method:__getitem__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.conv.conv2d||method:transpose||method:flatten||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||method:reshape||method:transpose||method:reshape||method:transpose||method:reshape||method:transpose||api:paddle.tensor.linalg.matmul||method:__mul__||api:paddle.nn.functional.activation.softmax||api:paddle.tensor.linalg.matmul||method:transpose||method:reshape||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.dropout||method:__truediv__||method:__add__||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||method:reshape||method:transpose||method:reshape||method:transpose||method:reshape||method:transpose||api:paddle.tensor.linalg.matmul||method:__mul__||api:paddle.nn.functional.activation.softmax||api:paddle.tensor.linalg.matmul||method:transpose||method:reshape||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.dropout||method:__truediv__||method:__add__||api:paddle.nn.functional.norm.layer_norm||api:paddle.nn.functional.common.linear||method:chunk||api:paddle.nn.functional.activation.gelu||method:__mul__||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.common.linear||method:__add__||method:reshape||method:transpose||api:paddle.nn.functional.conv.conv2d||method:__add__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.linear||method:__getitem__||method:__add__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.linear||method:__getitem__||method:__add__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.dropout||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.conv.conv2d||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.common.interpolate||api:paddle.nn.functional.conv.conv2d
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.common.interpolate||api:paddle.nn.functional.conv.conv2d
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# method:cast||method:cast||api:paddle.nn.functional.loss.mse_loss||method:mean||method:mean
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# method:transpose||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.linear||method:reshape||method:transpose||method:reshape||method:transpose||method:reshape||method:transpose||api:paddle.tensor.linalg.matmul||method:__mul__||method:cast||api:paddle.nn.functional.activation.softmax||method:cast||api:paddle.tensor.linalg.matmul||method:transpose||method:reshape||api:paddle.nn.functional.common.linear||api:paddle.nn.functional.common.dropout||method:transpose||method:reshape||method:__add__||method:__truediv__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.tensor.manipulation.chunk||api:paddle.tensor.math.clip||method:__rmul__||api:paddle.tensor.ops.exp||api:paddle.tensor.ops.exp
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.randn||method:__mul__||method:__add__||method:__mul__||api:paddle.randn||api:paddle.randint||method:cast||method:__getitem__||method:__pow__||method:flatten||method:unsqueeze||method:unsqueeze||method:unsqueeze||method:__getitem__||method:__rsub__||method:__pow__||method:flatten||method:unsqueeze||method:unsqueeze||method:unsqueeze||method:__mul__||method:__mul__||method:__add__
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.tensor.creation.arange||method:__rmul__||method:__truediv__||api:paddle.tensor.ops.exp||method:__getitem__||method:cast||method:__getitem__||method:__mul__||method:__rmul__||api:paddle.tensor.ops.sin||api:paddle.tensor.ops.cos||api:paddle.tensor.manipulation.concat||method:__getitem__||method:__getitem__||api:paddle.tensor.manipulation.concat
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.common.linear||api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.linear
import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# repo: diffusers_sub_grpah
# repo: diffusers_sub_graph
# model: stable_diffusion
# api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.conv.conv2d||api:paddle.nn.functional.activation.silu||api:paddle.nn.functional.common.linear||method:__getitem__||method:__add__
import unittest
Expand Down
Loading

0 comments on commit ce5accc

Please sign in to comment.