From e5f6a5b5320091240ec26bb37f3162d3a3a3c6ef Mon Sep 17 00:00:00 2001 From: fangfangssj <1135470306@qq.com> Date: Wed, 8 Jan 2025 12:28:03 +0000 Subject: [PATCH] fix --- _typos.toml | 8 -------- .../dialect/operator/transforms/pd_to_cinn_pass.cc | 12 ++++++------ paddle/cinn/hlir/framework/pir/fusion_info.cc | 2 +- paddle/cinn/hlir/pe/schedule.cc | 2 +- paddle/fluid/ir_adaptor/translator/CMakeLists.txt | 4 ++-- paddle/phi/kernels/funcs/segmented_array.h | 2 +- python/paddle/nn/functional/loss.py | 8 ++++---- test/dygraph_to_static/test_break_continue.py | 2 +- test/sot/test_step_profiler.py | 2 +- 9 files changed, 17 insertions(+), 25 deletions(-) diff --git a/_typos.toml b/_typos.toml index 81230a2f09629..6881222ba1773 100644 --- a/_typos.toml +++ b/_typos.toml @@ -269,14 +269,6 @@ suppport = 'suppport' SWTICH = 'SWTICH' Swith = 'Swith' sysyem = 'sysyem' -targt = 'targt' -Taget = 'Taget' -templat = 'templat' -temporaily = 'temporaily' -temporily = 'temporily' -Temperarily = 'Temperarily' -temporaly = 'temporaly' -Temperary = 'Temperary' tenosr = 'tenosr' iterm = 'iterm' termiante = 'termiante' diff --git a/paddle/cinn/hlir/dialect/operator/transforms/pd_to_cinn_pass.cc b/paddle/cinn/hlir/dialect/operator/transforms/pd_to_cinn_pass.cc index 008ef30762ece..37154af97ab85 100644 --- a/paddle/cinn/hlir/dialect/operator/transforms/pd_to_cinn_pass.cc +++ b/paddle/cinn/hlir/dialect/operator/transforms/pd_to_cinn_pass.cc @@ -41,21 +41,21 @@ using paddle::dialect::FullOp; namespace { -template +template bool IsDefinedBy(const SourceOpT &op, const size_t idx) { const pir::Operation *defined_op = op->operand_source(idx).defining_op(); - return defined_op && defined_op->isa(); + return defined_op && defined_op->isa(); } -template -TagetOpT CastDefinedTo(const SourceOpT &op, const size_t idx) { - PADDLE_ENFORCE_EQ(IsDefinedBy(op, idx), +template +TargetOpT CastDefinedTo(const SourceOpT &op, const size_t idx) { + PADDLE_ENFORCE_EQ(IsDefinedBy(op, idx), true, ::common::errors::PreconditionNotMet( "Required defined op shall not be nullptr and can cast " "to target type.")); pir::Operation *defined_op = op->operand_source(idx).defining_op(); - return defined_op->dyn_cast(); + return defined_op->dyn_cast(); } template diff --git a/paddle/cinn/hlir/framework/pir/fusion_info.cc b/paddle/cinn/hlir/framework/pir/fusion_info.cc index d445910e0909e..6d1067cfc52b7 100644 --- a/paddle/cinn/hlir/framework/pir/fusion_info.cc +++ b/paddle/cinn/hlir/framework/pir/fusion_info.cc @@ -236,7 +236,7 @@ std::ostream& operator<<(std::ostream& os, const FusionInfo& fusion_info) { std::vector TopologySort( const OpLoweringGroup& group) { - // NOTE(Aurelius84): Use simplest one-by-one order temporaly. + // NOTE(Aurelius84): Use simplest one-by-one order temporarily. auto* block = group.GetParentBlock(); std::vector ops; ops.reserve(block->size()); diff --git a/paddle/cinn/hlir/pe/schedule.cc b/paddle/cinn/hlir/pe/schedule.cc index dc30364bcda37..fada77826134b 100644 --- a/paddle/cinn/hlir/pe/schedule.cc +++ b/paddle/cinn/hlir/pe/schedule.cc @@ -211,7 +211,7 @@ int GetArrayPackingFactor(int shape, const cinn::common::Target &target) { int split_base = GetBasicFactor(type, target); int split_factor = 1; - // temporily use shape-1 instead of shape for isl wrong for1 elimination + // temporarily use shape-1 instead of shape for isl wrong for1 elimination int i = split_base * split_base < shape ? split_base * split_base : shape; for (; i > 1; i--) { if (shape % i == 0) { diff --git a/paddle/fluid/ir_adaptor/translator/CMakeLists.txt b/paddle/fluid/ir_adaptor/translator/CMakeLists.txt index c8b145c449e37..7cd1c839845e1 100644 --- a/paddle/fluid/ir_adaptor/translator/CMakeLists.txt +++ b/paddle/fluid/ir_adaptor/translator/CMakeLists.txt @@ -8,7 +8,7 @@ set(sparse_op_yaml ${PADDLE_SOURCE_DIR}/paddle/phi/ops/yaml/sparse_ops.yaml,${PADDLE_SOURCE_DIR}/paddle/phi/ops/yaml/sparse_backward.yaml ) set(op_compat_source_file ${PD_PROGRAM_TRANSLATOR_SOURCE_DIR}/op_compat_info.cc) -set(op_compat_templat_file +set(op_compat_template_file ${PD_PROGRAM_TRANSLATOR_SOURCE_DIR}/op_compat_info.cc.j2) add_custom_command( @@ -17,7 +17,7 @@ add_custom_command( ${PYTHON_EXECUTABLE} ${op_gen_file} --op_compat_yaml_file ${op_compat_yaml_file} --sparse_op_yaml ${sparse_op_yaml} --output_source_file ${op_compat_source_file} - DEPENDS ${op_gen_file} ${op_compat_yaml_file} ${op_compat_templat_file} + DEPENDS ${op_gen_file} ${op_compat_yaml_file} ${op_compat_template_file} VERBATIM) file(GLOB PD_PROGRAM_TRANSLATOR_SRCS "*.cc") diff --git a/paddle/phi/kernels/funcs/segmented_array.h b/paddle/phi/kernels/funcs/segmented_array.h index 24046da52aeee..71b7e5f4e5273 100644 --- a/paddle/phi/kernels/funcs/segmented_array.h +++ b/paddle/phi/kernels/funcs/segmented_array.h @@ -171,7 +171,7 @@ struct PointerArraySetter : public ArraySetterBase { // need_alloc : tensor data needs extra buffer or not. // use_cuda_graph: tensor data shall be captured by cuda_graph or not. - // pre_alloc_host_buf: tensor data is temporaily stored by pinned memory or + // pre_alloc_host_buf: tensor data is temporarily stored by pinned memory or // not. PointerArraySetter(const Context& ctx, std::vector* t, diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index cdd734c42a07e..8dd0e2f0a41ed 100644 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -4510,9 +4510,9 @@ def adaptive_log_softmax_with_loss( Tensor(shape=[], dtype=float32, place=Place(cpu), stop_gradient=True, 1.14779019) """ - targt_dim = label.dim() + target_dim = label.dim() - if targt_dim == 1: + if target_dim == 1: if input.shape[0] != label.shape[0]: raise ValueError( 'Input and label should have the same size ' @@ -4523,7 +4523,7 @@ def adaptive_log_softmax_with_loss( '1D label tensor expects 2D input tensors, ' f'but found inputs with size {input.shape}' ) - elif targt_dim == 0: + elif target_dim == 0: if input.dim() != 1: raise ValueError( '0D label tensor expects 1D input tensors, ' @@ -4534,7 +4534,7 @@ def adaptive_log_softmax_with_loss( '0D or 1D label tensor expected, ' 'multi-label not supported' ) - is_batched = targt_dim > 0 + is_batched = target_dim > 0 input = input if is_batched else input.unsqueeze(0) label = label if is_batched else label.unsqueeze(0) diff --git a/test/dygraph_to_static/test_break_continue.py b/test/dygraph_to_static/test_break_continue.py index 0d15dac284371..ad6ade66ac74f 100644 --- a/test/dygraph_to_static/test_break_continue.py +++ b/test/dygraph_to_static/test_break_continue.py @@ -351,7 +351,7 @@ def init_dygraph_func(self): def test_transformed_static_result(self): self.init_dygraph_func() dygraph_res = self.run_dygraph_mode() - # NOTE(SigureMo): Temperary run the test in sequential run mode to avoid dependency + # NOTE(SigureMo): Temporarily run the test in sequential run mode to avoid dependency # on the execution order of the test cases. if use_pir_api(): with exe_sequential_run_guard(True): diff --git a/test/sot/test_step_profiler.py b/test/sot/test_step_profiler.py index 82279b3bc0954..b6c895281959a 100644 --- a/test/sot/test_step_profiler.py +++ b/test/sot/test_step_profiler.py @@ -43,7 +43,7 @@ def forward(self, x): class TestStepProfilerSmokeTest(unittest.TestCase): - # Temperarily disable this test + # Temporarily disable this test # @sot_step_profiler_guard(True) @strict_mode_guard(False) def test_step_profiler_smoke(self):