From 43d3b781484e7e4238ed157b0327ef27bfe9482d Mon Sep 17 00:00:00 2001 From: enkilee Date: Wed, 22 Jan 2025 10:35:50 +0800 Subject: [PATCH] fix --- _typos.toml | 8 +------- .../pir_graph_analyzing/shardable_axes_base.cc | 16 ++++++++-------- .../api/demo_ci/onnxruntime_mobilenet_demo.cc | 4 ++-- .../infer_symbolic_shape/unary_infer_sym.cc | 2 +- paddle/phi/backends/xpu/xpu_context.cc | 2 +- paddle/phi/infermeta/spmd_rules/add_n.cc | 4 ++-- paddle/phi/infermeta/ternary.cc | 3 ++- paddle/phi/kernels/funcs/fused_gate_attention.h | 10 +++++----- paddle/phi/kernels/funcs/unsqueeze.h | 2 +- .../kernels/fusion/onednn/fusion_gru_kernel.cc | 2 +- .../shape/transforms/shape_optimization_pass.cc | 2 +- .../paddle/distributed/communication/scatter.py | 2 +- .../quantization/post_training_quantization.py | 2 +- test/auto_parallel/pir/test_op_role.py | 2 +- .../data_structure_tests/autograd_meta_test.cc | 2 +- .../test_imperative_signal_handler.py | 2 +- 16 files changed, 30 insertions(+), 35 deletions(-) diff --git a/_typos.toml b/_typos.toml index 594f9200ef5d4..675f1b558f7f1 100644 --- a/_typos.toml +++ b/_typos.toml @@ -113,13 +113,7 @@ Regiter = 'Regiter' Runing = 'Runing' runing = 'runing' setted = 'setted' -shoule = 'shoule' -shoud = 'shoud' -Singal = 'Singal' -Similiar = 'Similiar' -simular = 'simular' -Simle = 'Simle' -signle = 'signle' + Skiped = 'Skiped' skiped = 'skiped' smll = 'smll' diff --git a/paddle/cinn/operator_fusion/pir_graph_analyzing/shardable_axes_base.cc b/paddle/cinn/operator_fusion/pir_graph_analyzing/shardable_axes_base.cc index 95154146cba6c..8452d0b2bab1f 100644 --- a/paddle/cinn/operator_fusion/pir_graph_analyzing/shardable_axes_base.cc +++ b/paddle/cinn/operator_fusion/pir_graph_analyzing/shardable_axes_base.cc @@ -196,14 +196,14 @@ ShardableAxesSignature CreateSignatureForTranspose(pir::Operation* op) { std::vector perm = GetInt32ArrayAttributeData(op->attributes().at("perm")); - PADDLE_ENFORCE_LE( - perm.size(), - input_axes.size(), - ::common::errors::PreconditionNotMet( - "The size of perm shoud be equal to or less than the input rank. But " - "received perm size is %d, input rank is %d", - perm.size(), - input_axes.size())); + PADDLE_ENFORCE_LE(perm.size(), + input_axes.size(), + ::common::errors::PreconditionNotMet( + "The size of perm should be equal to or less than the " + "input rank. But " + "received perm size is %d, input rank is %d", + perm.size(), + input_axes.size())); std::vector output_axes = input_axes; for (size_t i = 0; i < perm.size(); ++i) { output_axes[i] = input_axes[perm[i]]; diff --git a/paddle/fluid/inference/api/demo_ci/onnxruntime_mobilenet_demo.cc b/paddle/fluid/inference/api/demo_ci/onnxruntime_mobilenet_demo.cc index 417a8917d1fbd..1a63d3889b9e8 100644 --- a/paddle/fluid/inference/api/demo_ci/onnxruntime_mobilenet_demo.cc +++ b/paddle/fluid/inference/api/demo_ci/onnxruntime_mobilenet_demo.cc @@ -89,8 +89,8 @@ void Main() { PADDLE_ENFORCE_LE(fabs(max_score - 0.99981), 1e-4, common::errors::InvalidArgument( - "Required fabs(max_score - 0.99981) shoule " - "be less than or euqal to 1e-4. ")); + "Required fabs(max_score - 0.99981) should " + "be less than or equal to 1e-4. ")); } } // namespace demo diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc index 19fff2ec2be4e..fb6625e3989e0 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc @@ -2534,7 +2534,7 @@ bool PixelShuffleOpInferSymbolicShape( const bool channel_last = (data_format == "NHWC"); - // the number of channels shoule be able to be divided by the upscale_factor + // the number of channels should be able to be divided by the upscale_factor // ^ 2. // TODO(Lans1ot, Buaa): add constrain for the channel number and // upscale_factor diff --git a/paddle/phi/backends/xpu/xpu_context.cc b/paddle/phi/backends/xpu/xpu_context.cc index 0d33141ce0f65..73374031086b2 100644 --- a/paddle/phi/backends/xpu/xpu_context.cc +++ b/paddle/phi/backends/xpu/xpu_context.cc @@ -381,7 +381,7 @@ void XPUContext::CheckValidStreamId(int i) const { PADDLE_ENFORCE_LT( i, GetStreamNum(), - errors::InvalidArgument("The stream index shoule be less than the number " + errors::InvalidArgument("The stream index should be less than the number " "of stream used (%d), but got %d", GetStreamNum(), i)); diff --git a/paddle/phi/infermeta/spmd_rules/add_n.cc b/paddle/phi/infermeta/spmd_rules/add_n.cc index 80cfeb1f88ffd..afb03f2d1fce0 100644 --- a/paddle/phi/infermeta/spmd_rules/add_n.cc +++ b/paddle/phi/infermeta/spmd_rules/add_n.cc @@ -37,12 +37,12 @@ SpmdInfo AddNInferSpmd( input_ndim, ndim, common::errors::InvalidArgument("AddNInferSpmd, The all input's rank " - "shoule be the same as first input.")); + "should be the same as first input.")); PADDLE_ENFORCE_EQ(ndim, input_dims_mapping.size(), common::errors::InvalidArgument( "AddNInferSpmd, The all input's dimmapping size " - "shoule be the same as first input.")); + "should be the same as first input.")); tensor_axes_to_dim_pairs.push_back( std::make_pair(axes, input_dims_mapping)); } diff --git a/paddle/phi/infermeta/ternary.cc b/paddle/phi/infermeta/ternary.cc index 0c6a3ecc646af..0920ee379ddfd 100644 --- a/paddle/phi/infermeta/ternary.cc +++ b/paddle/phi/infermeta/ternary.cc @@ -1863,7 +1863,8 @@ void ScatterInferMeta(const MetaTensor& x, index_dims[0], updates_dims[0], common::errors::InvalidArgument( - "The first dimension size of Input(Index) shoud be no greater than " + "The first dimension size of Input(Index) should be no greater " + "than " "Input(Updates), but received first dimension size of Input(Index) " "is %d, Input(Updates) is %d.", index_dims[0], diff --git a/paddle/phi/kernels/funcs/fused_gate_attention.h b/paddle/phi/kernels/funcs/fused_gate_attention.h index ae49552e86003..89070a1e26ce6 100644 --- a/paddle/phi/kernels/funcs/fused_gate_attention.h +++ b/paddle/phi/kernels/funcs/fused_gate_attention.h @@ -32,7 +32,7 @@ namespace phi { namespace funcs { template -__global__ void SimleScaleKernel(int64_t numel, float scale, T* inout) { +__global__ void SimpleScaleKernel(int64_t numel, float scale, T* inout) { CUDA_KERNEL_LOOP_TYPE(i, numel, int64_t) { inout[i] = static_cast(scale * static_cast(inout[i])); } @@ -1247,10 +1247,10 @@ class FlashAttnWithGating { auto gpu_config = phi::backends::gpu::GetGpuLaunchConfig1D(dev_ctx_, numel, 1); - SimleScaleKernel<<>>(numel, scale, ptr); + SimpleScaleKernel<<>>(numel, scale, ptr); } const phi::GPUContext& dev_ctx_; diff --git a/paddle/phi/kernels/funcs/unsqueeze.h b/paddle/phi/kernels/funcs/unsqueeze.h index 7765548321cb8..3f468c276753c 100644 --- a/paddle/phi/kernels/funcs/unsqueeze.h +++ b/paddle/phi/kernels/funcs/unsqueeze.h @@ -128,7 +128,7 @@ inline DDim GetUnsqueezeShape(const std::vector unsqz_dims, PADDLE_ENFORCE_LE(cur, cur_output_rank, common::errors::InvalidArgument( - "The insert dimension value shoule not be larger " + "The insert dimension value should not be larger " "than the dimension size of input tensor")); // Move old axis, and insert new axis for (int i = cur_output_rank; i >= cur; --i) { diff --git a/paddle/phi/kernels/fusion/onednn/fusion_gru_kernel.cc b/paddle/phi/kernels/fusion/onednn/fusion_gru_kernel.cc index 57c70df919a5f..b950928d48e68 100644 --- a/paddle/phi/kernels/fusion/onednn/fusion_gru_kernel.cc +++ b/paddle/phi/kernels/fusion/onednn/fusion_gru_kernel.cc @@ -579,7 +579,7 @@ void FusionGRUKernel(const Context& dev_ctx, mkldnn_data_type) != mkldnn_data_type_list.end(), true, common::errors::InvalidArgument( - "The mkldnn_data_type shoule be [float32, " + "The mkldnn_data_type should be [float32, " "int8, bfloat16], but found %s.", mkldnn_data_type.c_str())); const float scale_data = diff --git a/paddle/pir/src/dialect/shape/transforms/shape_optimization_pass.cc b/paddle/pir/src/dialect/shape/transforms/shape_optimization_pass.cc index 2991455a11cfc..0d4ec7676c058 100644 --- a/paddle/pir/src/dialect/shape/transforms/shape_optimization_pass.cc +++ b/paddle/pir/src/dialect/shape/transforms/shape_optimization_pass.cc @@ -190,7 +190,7 @@ void CheckInferSymWithInferMeta( << " [id:" << op->id() << "] " << " carefully! " << "shape[" << i - << "] of infer_sym_shape shoule be int64_t NOT a symbol!"; + << "] of infer_sym_shape should be int64_t NOT a symbol!"; LOG(ERROR) << print_stream.str(); continue; } diff --git a/python/paddle/distributed/communication/scatter.py b/python/paddle/distributed/communication/scatter.py index 493302d3d744c..0c4ee64242dfc 100644 --- a/python/paddle/distributed/communication/scatter.py +++ b/python/paddle/distributed/communication/scatter.py @@ -96,7 +96,7 @@ def scatter_object_list( ) -> None: """ - Scatter picklable objects from the source to all others. Similiar to scatter(), but python object can be passed in. + Scatter picklable objects from the source to all others. Similar to scatter(), but python object can be passed in. Args: out_object_list (list): The list of objects to store the scattered objects. diff --git a/python/paddle/static/quantization/post_training_quantization.py b/python/paddle/static/quantization/post_training_quantization.py index 342f6419b695a..c8c8a5a64b5da 100644 --- a/python/paddle/static/quantization/post_training_quantization.py +++ b/python/paddle/static/quantization/post_training_quantization.py @@ -638,7 +638,7 @@ def collect_var_name(var_name_list, persistable_var_names, op_type): op._set_attr("op_namescope", "skip_quant") op_type = op.type - # skip quant form simular conv1d_transpose + # skip quant form similar conv1d_transpose if op_type == 'conv2d_transpose': in_name = op.input("Filter")[0] for _op in self._program.blocks[block_id].ops: diff --git a/test/auto_parallel/pir/test_op_role.py b/test/auto_parallel/pir/test_op_role.py index 0e34b55be8e56..14f98c9121d1f 100644 --- a/test/auto_parallel/pir/test_op_role.py +++ b/test/auto_parallel/pir/test_op_role.py @@ -32,7 +32,7 @@ class TestOpRole(unittest.TestCase): - def test_signle(self): + def test_single(self): paddle.enable_static() with paddle.pir_utils.IrGuard(): main_program = paddle.base.Program() diff --git a/test/cpp/eager/data_structure_tests/autograd_meta_test.cc b/test/cpp/eager/data_structure_tests/autograd_meta_test.cc index 9e8533d5d50c9..f31ab87fbe9b1 100644 --- a/test/cpp/eager/data_structure_tests/autograd_meta_test.cc +++ b/test/cpp/eager/data_structure_tests/autograd_meta_test.cc @@ -49,7 +49,7 @@ TEST(AutogradMeta, MemberFunction) { VLOG(6) << "Test Grad"; PADDLE_ENFORCE_EQ(tmp_auto->Grad().defined(), false, - common::errors::Fatal("grad shoule not be defined now")); + common::errors::Fatal("grad should not be defined now")); auto* grad_t = tmp_auto->MutableGrad(); phi::DenseTensorMeta meta = phi::DenseTensorMeta(phi::DataType::FLOAT32, common::make_ddim({1, 2})); diff --git a/test/legacy_test/test_imperative_signal_handler.py b/test/legacy_test/test_imperative_signal_handler.py index 8ed10104b1cd8..3e797b703103b 100644 --- a/test/legacy_test/test_imperative_signal_handler.py +++ b/test/legacy_test/test_imperative_signal_handler.py @@ -36,7 +36,7 @@ def __handler__(signum, frame): signal.signal(signal.SIGCHLD, __handler__) -class DygraphDataLoaderSingalHandler(unittest.TestCase): +class DygraphDataLoaderSignalHandler(unittest.TestCase): def test_child_process_exit_with_error(self): def __test_process__(): core._set_process_signal_handler()