From ce5acccffb772ee8850925bed3bad240160b9b73 Mon Sep 17 00:00:00 2001 From: cyberslack_lee Date: Thu, 26 Dec 2024 15:17:33 +0800 Subject: [PATCH] [CodeStyle][Typos][G-[1-5]] Fix typos(guassian, gloabl, graident, grammer, grpah) (#70460) --- _typos.toml | 5 ----- paddle/phi/kernels/gpu/lars_momentum_kernel.cu | 2 +- .../pipeline_zero_bubble.py | 2 +- python/paddle/jit/dy2static/program_translator.py | 2 +- python/paddle/nn/initializer/normal.py | 2 +- test/cpp/pir/core/program_translator_test.cc | 2 +- test/dygraph_to_static/test_seq2seq.py | 4 ++-- test/indexing/test_setitem.py | 12 ++++++------ .../pir/cinn/symbolic/test_sub_graph_batch_norm.py | 2 +- .../test_sub_graph_stable_diffusion_0_st.py | 2 +- .../test_sub_graph_stable_diffusion_10_st.py | 2 +- .../test_sub_graph_stable_diffusion_11_st.py | 2 +- .../test_sub_graph_stable_diffusion_12_st.py | 2 +- .../test_sub_graph_stable_diffusion_13_st.py | 2 +- .../test_sub_graph_stable_diffusion_14_st.py | 2 +- .../test_sub_graph_stable_diffusion_15_st.py | 2 +- .../test_sub_graph_stable_diffusion_16_st.py | 2 +- .../test_sub_graph_stable_diffusion_17_st.py | 2 +- .../test_sub_graph_stable_diffusion_18_st.py | 2 +- .../test_sub_graph_stable_diffusion_19_st.py | 2 +- .../test_sub_graph_stable_diffusion_1_st.py | 2 +- .../test_sub_graph_stable_diffusion_20_st.py | 2 +- .../test_sub_graph_stable_diffusion_21_st.py | 2 +- .../test_sub_graph_stable_diffusion_22_st.py | 2 +- .../test_sub_graph_stable_diffusion_23_st.py | 2 +- .../test_sub_graph_stable_diffusion_24_st.py | 2 +- .../test_sub_graph_stable_diffusion_25_st.py | 2 +- .../test_sub_graph_stable_diffusion_2_st.py | 2 +- .../test_sub_graph_stable_diffusion_3_st.py | 2 +- .../test_sub_graph_stable_diffusion_4_st.py | 2 +- .../test_sub_graph_stable_diffusion_5_st.py | 2 +- .../test_sub_graph_stable_diffusion_6_st.py | 2 +- .../test_sub_graph_stable_diffusion_7_st.py | 2 +- .../test_sub_graph_stable_diffusion_8_st.py | 2 +- .../test_sub_graph_stable_diffusion_9_st.py | 2 +- test/legacy_test/test_grad_clip_minimize.py | 14 +++++++------- tools/gen_ut_cmakelists.py | 6 +++--- 37 files changed, 50 insertions(+), 55 deletions(-) diff --git a/_typos.toml b/_typos.toml index 0fab5391784d25..1a89687f01bf12 100644 --- a/_typos.toml +++ b/_typos.toml @@ -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' diff --git a/paddle/phi/kernels/gpu/lars_momentum_kernel.cu b/paddle/phi/kernels/gpu/lars_momentum_kernel.cu index be8b1ff3796d01..38777241191681 100644 --- a/paddle/phi/kernels/gpu/lars_momentum_kernel.cu +++ b/paddle/phi/kernels/gpu/lars_momentum_kernel.cu @@ -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(p_part_sum, FINAL_MASK); diff --git a/python/paddle/distributed/passes/pipeline_scheduler_pass/pipeline_zero_bubble.py b/python/paddle/distributed/passes/pipeline_scheduler_pass/pipeline_zero_bubble.py index d2f03b0d2a6aa5..d6025d80e5e7c8 100644 --- a/python/paddle/distributed/passes/pipeline_scheduler_pass/pipeline_zero_bubble.py +++ b/python/paddle/distributed/passes/pipeline_scheduler_pass/pipeline_zero_bubble.py @@ -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." diff --git a/python/paddle/jit/dy2static/program_translator.py b/python/paddle/jit/dy2static/program_translator.py index 3323fa43f1e956..dcf84c7428a669 100644 --- a/python/paddle/jit/dy2static/program_translator.py +++ b/python/paddle/jit/dy2static/program_translator.py @@ -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(): diff --git a/python/paddle/nn/initializer/normal.py b/python/paddle/nn/initializer/normal.py index 7caddb85bc0844..9e7b8f2e9c3377 100644 --- a/python/paddle/nn/initializer/normal.py +++ b/python/paddle/nn/initializer/normal.py @@ -89,7 +89,7 @@ def forward( "complex64", "complex128", ], - "guassian_random", + "gaussian_random", ) if self._seed == 0: diff --git a/test/cpp/pir/core/program_translator_test.cc b/test/cpp/pir/core/program_translator_test.cc index 2c0a1c6cf682ff..23cfe77ceca091 100644 --- a/test/cpp/pir/core/program_translator_test.cc +++ b/test/cpp/pir/core/program_translator_test.cc @@ -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; diff --git a/test/dygraph_to_static/test_seq2seq.py b/test/dygraph_to_static/test_seq2seq.py index 0c14b4d3985362..7eace0f147d411 100644 --- a/test/dygraph_to_static/test_seq2seq.py +++ b/test/dygraph_to_static/test_seq2seq.py @@ -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() diff --git a/test/indexing/test_setitem.py b/test/indexing/test_setitem.py index 58c49f131e7406..5eabbace408ee6 100644 --- a/test/indexing/test_setitem.py +++ b/test/indexing/test_setitem.py @@ -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)) @@ -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)) @@ -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)) @@ -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)) @@ -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)) @@ -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)) diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_batch_norm.py b/test/ir/pir/cinn/symbolic/test_sub_graph_batch_norm.py index d55aabe6777816..6d52137bde2f5f 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_batch_norm.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_batch_norm.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_0_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_0_st.py index b24e74f0590cb0..c3030f6feaa2a0 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_0_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_0_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_10_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_10_st.py index 1a46bae4fba369..533e89c51ee478 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_10_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_10_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_11_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_11_st.py index 22567d24d00dfe..22141f1765a2eb 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_11_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_11_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_12_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_12_st.py index c00bc83ec80afd..cf93b82de262cc 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_12_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_12_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_13_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_13_st.py index 192976b0541adf..3a851f297708fc 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_13_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_13_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_14_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_14_st.py index af4c3613302664..02acfa3d069ebb 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_14_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_14_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_15_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_15_st.py index a78f2ea9ee5384..3cc1bc00056873 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_15_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_15_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_16_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_16_st.py index d28f5667c8237a..d9cf60497bfe34 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_16_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_16_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_17_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_17_st.py index 8b1f87d654e620..fc135825b2e683 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_17_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_17_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_18_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_18_st.py index 5b8f505a4fc847..18937d78f4ac8e 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_18_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_18_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_19_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_19_st.py index 4ae7c90286e7f8..8c9b7cbaf3e3ee 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_19_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_19_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_1_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_1_st.py index a3b9be59506de1..23cbb3b56752b8 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_1_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_1_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_20_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_20_st.py index 2b213427320a21..8c7ea4ce0ed2fb 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_20_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_20_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_21_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_21_st.py index 9e94642c449f0a..695c2522fcaca4 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_21_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_21_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_22_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_22_st.py index 7fa4ef4ce42955..279979541cbb37 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_22_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_22_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_23_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_23_st.py index 24640fdce80e53..680dae0ba1bab3 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_23_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_23_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_24_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_24_st.py index 31f730c9ead168..a0e50bc1049f18 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_24_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_24_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_25_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_25_st.py index 63ad2362de0852..f2d16ea7728c25 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_25_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_25_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_2_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_2_st.py index 16363441da9c37..9285a9f8af7ace 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_2_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_2_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_3_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_3_st.py index 4c292c0741358a..1b806000f20cb7 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_3_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_3_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_4_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_4_st.py index 034833070e33f8..791accb81f4c3c 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_4_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_4_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_5_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_5_st.py index 183a39d8dc9ed7..41d04c35e410d3 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_5_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_5_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_6_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_6_st.py index 2479eff8a93562..e8c0ddf3e9886c 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_6_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_6_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_7_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_7_st.py index 28a8d02a6702ae..c6ba3f05bef13a 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_7_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_7_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_8_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_8_st.py index 5cef564d61a468..94a8cf753086ce 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_8_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_8_st.py @@ -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 diff --git a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_9_st.py b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_9_st.py index a03d352478fe1a..b6112bbb101ac3 100644 --- a/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_9_st.py +++ b/test/ir/pir/cinn/symbolic/test_sub_graph_stable_diffusion_9_st.py @@ -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 diff --git a/test/legacy_test/test_grad_clip_minimize.py b/test/legacy_test/test_grad_clip_minimize.py index 6b659c38e0cff7..ef261392e53d2e 100644 --- a/test/legacy_test/test_grad_clip_minimize.py +++ b/test/legacy_test/test_grad_clip_minimize.py @@ -43,16 +43,16 @@ def generate_p_g(self): ) def get_numpy_global_norm_result(self): - gloabl_norm = 0.0 + global_norm = 0.0 for p, g in self.para_and_grad: - gloabl_norm += np.sum(np.square(g)) + global_norm += np.sum(np.square(g)) - gloabl_norm_np = np.sqrt(gloabl_norm) + global_norm_np = np.sqrt(global_norm) new_np_p_g = [] scale = 1.0 - if gloabl_norm_np > self.max_global_norm: - scale = self.max_global_norm / gloabl_norm_np + if global_norm_np > self.max_global_norm: + scale = self.max_global_norm / global_norm_np for p, g in self.para_and_grad: new_np_p_g.append((p, g * scale)) @@ -61,14 +61,14 @@ def get_numpy_global_norm_result(self): def get_dygrap_global_norm_result(self): with base.dygraph.guard(): - gloabl_norm_clip = ClipGradByGlobalNorm(self.max_global_norm) + global_norm_clip = ClipGradByGlobalNorm(self.max_global_norm) p_g_var = [] for p, g in self.para_and_grad: new_p = paddle.to_tensor(p) new_g = paddle.to_tensor(g) p_g_var.append((new_p, new_g)) - new_p_g_var = gloabl_norm_clip(p_g_var) + new_p_g_var = global_norm_clip(p_g_var) p_g_dy_out = [] for p, g in new_p_g_var: diff --git a/tools/gen_ut_cmakelists.py b/tools/gen_ut_cmakelists.py index 865cbf18c558af..e4a161106664db 100644 --- a/tools/gen_ut_cmakelists.py +++ b/tools/gen_ut_cmakelists.py @@ -64,7 +64,7 @@ def _process_envs(envs): def _process_conditions(conditions): """ Desc: - Input condition expression in cmake grammer and return a string warpped by 'AND ()'. + Input condition expression in cmake grammar and return a string warpped by 'AND ()'. If the conditions string is empty, return an empty string. Example 1: Input: "LINUX" @@ -83,7 +83,7 @@ def _process_conditions(conditions): def _proccess_archs(arch): """ desc: - Input archs options and warp it with 'WITH_', 'OR' and '()' in cmakelist grammer. + Input archs options and warp it with 'WITH_', 'OR' and '()' in cmakelist grammar. The case is ignored. If the input is empty, return "LOCAL_ALL_ARCH". Example 1: @@ -415,7 +415,7 @@ def _find_root_dirs(self): def _parse_line(self, line, curdir): """ Desc: - Input a line in csv file and output a string in cmake grammer, adding the specified test and setting its properties. + Input a line in csv file and output a string in cmake grammar, adding the specified test and setting its properties. Example: Input: "test_allreduce,linux,gpu;rocm,120,DIST,test_runner.py,20071,1,PYTHONPATH=..;http_proxy=;https_proxy=," Output: