From af91d96108e379aa02e407f530694b866c217488 Mon Sep 17 00:00:00 2001 From: co63oc Date: Mon, 22 Jan 2024 14:02:12 +0800 Subject: [PATCH] Fix --- paddle/cinn/ir/schedule/schedule_desc.h | 4 +- paddle/cinn/ir/test/ir_compare_test.cc | 2 +- paddle/cinn/ir/test/schedule_desc_test.cc | 2 +- paddle/cinn/ir/utils/ir_compare.cc | 2 +- paddle/cinn/ir/utils/ir_compare.h | 4 +- .../fluid/framework/fleet/ps_gpu_wrapper.cc | 4 +- paddle/fluid/pir/transforms/inplace_pass.cc | 10 ++--- .../pir/transforms/pd_op_to_kernel_pass.cc | 2 +- .../transforms/transform_general_functions.h | 2 +- paddle/phi/infermeta/binary.cc | 4 +- paddle/phi/infermeta/fusion.cc | 4 +- paddle/phi/infermeta/multiary.cc | 8 ++-- paddle/phi/infermeta/unary.cc | 4 +- paddle/phi/kernels/cpu/conv_util.h | 2 +- .../memory_efficient_attention_grad_kernel.cu | 40 +++++++++---------- 15 files changed, 47 insertions(+), 47 deletions(-) diff --git a/paddle/cinn/ir/schedule/schedule_desc.h b/paddle/cinn/ir/schedule/schedule_desc.h index eeaca70ca0e94e..4458bcb4ed1175 100644 --- a/paddle/cinn/ir/schedule/schedule_desc.h +++ b/paddle/cinn/ir/schedule/schedule_desc.h @@ -31,7 +31,7 @@ namespace ir { // records all transform/getting operations executed by a corresponding // ir::IRSchedule. A ScheduleDesc can be serialized to JSON format and saved to // file. For deserializing, it can be re-applied to a new IRSchedule that is -// initialzied by a semantics-euqal original ir::ModuleExpr, and then achieves +// initialzied by a semantics-equal original ir::ModuleExpr, and then achieves // the same result. class IRSchedule; // forward declartion to avoid cross-reference @@ -78,7 +78,7 @@ class ScheduleDesc { /** * \brief Replay this description to a new IRSchedule that is initialzied by a - * semantics-euqal original ModuleExpr. + * semantics-equal original ModuleExpr. * @param schedule The original IRSchedule to be replayed the description on. * @param without_post_schedule Determine whether to delete the post * schedules. diff --git a/paddle/cinn/ir/test/ir_compare_test.cc b/paddle/cinn/ir/test/ir_compare_test.cc index bb1c6eb46866cd..c705c537b3a28e 100644 --- a/paddle/cinn/ir/test/ir_compare_test.cc +++ b/paddle/cinn/ir/test/ir_compare_test.cc @@ -132,7 +132,7 @@ TEST(TestIrCompare, SingleFunction) { ASSERT_TRUE(IRCompare(funcs_1.front(), funcs_2.front())); // compare with itself ASSERT_TRUE(IRCompare(funcs_1.front(), funcs_1.front())); - // they are euqal if allowing suffix of name different + // they are equal if allowing suffix of name different ASSERT_TRUE(IRCompare(funcs_1.front(), funcs_2.front(), true)); ASSERT_FALSE(IRCompare(funcs_1.front(), funcs_3.front())); diff --git a/paddle/cinn/ir/test/schedule_desc_test.cc b/paddle/cinn/ir/test/schedule_desc_test.cc index dcd8b90ef120dd..860142797be7b1 100644 --- a/paddle/cinn/ir/test/schedule_desc_test.cc +++ b/paddle/cinn/ir/test/schedule_desc_test.cc @@ -105,7 +105,7 @@ std::string SourceCodeGen(const ModuleExpr& module_expr, const std::vector& lowered_funcs, const Target& target) { auto exprs = module_expr.GetExprs(); - CHECK_EQ(exprs.size(), lowered_funcs.size()) << "size of func is not euqal"; + CHECK_EQ(exprs.size(), lowered_funcs.size()) << "size of func is not equal"; std::vector updated_funcs = ir::ir_utils::IRCopy(lowered_funcs); Module::Builder builder("test_module", target); diff --git a/paddle/cinn/ir/utils/ir_compare.cc b/paddle/cinn/ir/utils/ir_compare.cc index 0cd521c65542eb..b88d90f8817c9f 100644 --- a/paddle/cinn/ir/utils/ir_compare.cc +++ b/paddle/cinn/ir/utils/ir_compare.cc @@ -76,7 +76,7 @@ bool IrEqualVisitor::Compare(const std::string& lhs, const std::string& rhs) { } if (!equal) { - VLOG(5) << "Not euqal on name, lhs=" << lhs << ", rhs=" << rhs; + VLOG(5) << "Not equal on name, lhs=" << lhs << ", rhs=" << rhs; } return equal; diff --git a/paddle/cinn/ir/utils/ir_compare.h b/paddle/cinn/ir/utils/ir_compare.h index ef978a024b0f71..b59222530eab90 100644 --- a/paddle/cinn/ir/utils/ir_compare.h +++ b/paddle/cinn/ir/utils/ir_compare.h @@ -22,7 +22,7 @@ namespace cinn { namespace ir { namespace ir_utils { -// Determine whether two ir AST trees are euqal by comparing their struct and +// Determine whether two ir AST trees are equal by comparing their struct and // fields of each node through dfs visitor class IrEqualVisitor : public IRVisitorRequireReImpl { public: @@ -30,7 +30,7 @@ class IrEqualVisitor : public IRVisitorRequireReImpl { bool only_compare_structure = false) : allow_name_suffix_diff_(allow_name_suffix_diff), only_compare_structure_(only_compare_structure) {} - // Return true if they are euqal, otherwise false; + // Return true if they are equal, otherwise false; bool Compare(const Expr& lhs, const Expr& rhs); private: diff --git a/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc b/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc index a13f6372501c6f..b3e48e0d5b63b9 100644 --- a/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc +++ b/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc @@ -386,7 +386,7 @@ void PSGPUWrapper::PreBuildTask(std::shared_ptr gpu_task, for (size_t i = 0; i < keys_vec.size(); ++i) { if (!infer_mode_ || sage_mode_) { CHECK_EQ(keys_vec[i]->size(), ranks_vec[i]->size()) - << keys_vec[i]->size() << " should be euqal to " + << keys_vec[i]->size() << " should be equal to " << ranks_vec[i]->size(); for (size_t j = 0; j < keys_vec[i]->size(); ++j) { auto& key = (*keys_vec[i])[j]; @@ -398,7 +398,7 @@ void PSGPUWrapper::PreBuildTask(std::shared_ptr gpu_task, } } else { CHECK_EQ(ranks_vec[i]->size(), 0UL) - << ranks_vec[i]->size() << " should be euqal to 0"; + << ranks_vec[i]->size() << " should be equal to 0"; for (size_t j = 0; j < keys_vec[i]->size(); ++j) { auto& key = (*keys_vec[i])[j]; int shard_idx = key % thread_keys_thread_num_; diff --git a/paddle/fluid/pir/transforms/inplace_pass.cc b/paddle/fluid/pir/transforms/inplace_pass.cc index c862ec92457015..9b645535473fa9 100644 --- a/paddle/fluid/pir/transforms/inplace_pass.cc +++ b/paddle/fluid/pir/transforms/inplace_pass.cc @@ -91,7 +91,7 @@ bool CanDoInplace(const std::unordered_set& eager_dels, return true; } - auto is_numel_euqal = [](const TensorType& in, + auto is_numel_equal = [](const TensorType& in, const TensorType& out) -> bool { int64_t in_numel = 1; int64_t out_numel = 1; @@ -127,7 +127,7 @@ bool CanDoInplace(const std::unordered_set& eager_dels, }; // In this version, we don't consider the -1 in ddim, we just calculate the // result. - auto is_numel_euqal_loose_version = [](const TensorType& in, + auto is_numel_equal_loose_version = [](const TensorType& in, const TensorType& out) -> bool { auto calculate_numel = [](const phi::DDim& ddim) -> int64_t { int64_t numel = 1; @@ -144,10 +144,10 @@ bool CanDoInplace(const std::unordered_set& eager_dels, bool equal = false; bool relax = (RelaxShapeCheckOps.count(op_name) > 0); if (relax) { - equal = is_numel_euqal_loose_version(input_alloc_tensor_type, + equal = is_numel_equal_loose_version(input_alloc_tensor_type, output_alloc_tensor_type); } else { - equal = is_numel_euqal(input_alloc_tensor_type, output_alloc_tensor_type); + equal = is_numel_equal(input_alloc_tensor_type, output_alloc_tensor_type); } if (!equal) { @@ -159,7 +159,7 @@ bool CanDoInplace(const std::unordered_set& eager_dels, return false; } if (eager_dels.count(input) == 0) { - VLOG(9) << " -- input not in eager_deletion_valus, can't do inplace"; + VLOG(9) << " -- input not in eager_deletion_vars, can't do inplace"; return false; } return true; diff --git a/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc b/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc index 3c6391dcd06d3a..8caa7e9d8a6a2d 100644 --- a/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc +++ b/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc @@ -189,7 +189,7 @@ static bool NeedFallBackCpu(const pir::Operation* op, static bool NeedFallBackFromGPUDNN2GPU(pir::Operation* op, const phi::KernelKey kernel_key) { // NOTE(phlrain): keep the same kernel select strategy with - // GetExepectKernelKey + // GetExpectKernelKey if (op->isa() || op->isa() || op->isa() || op->isa()) { if (kernel_key.backend() == phi::Backend::GPUDNN && diff --git a/paddle/fluid/pir/transforms/transform_general_functions.h b/paddle/fluid/pir/transforms/transform_general_functions.h index 28314527c09086..82ca3ae79491f1 100644 --- a/paddle/fluid/pir/transforms/transform_general_functions.h +++ b/paddle/fluid/pir/transforms/transform_general_functions.h @@ -67,7 +67,7 @@ Operation* GetDefiningOpForInput(const Operation* op, uint32_t index); * @brief Get operations and the index of designative op operand (op result) that use the specific output of the operation. * - * @param const Operation* cosnt pointer to an operation + * @param const Operation* const pointer to an operation * @param uint32_t index of result of the operation * @return std::vector> diff --git a/paddle/phi/infermeta/binary.cc b/paddle/phi/infermeta/binary.cc index 09184c24eb5dea..b94f28b203943b 100644 --- a/paddle/phi/infermeta/binary.cc +++ b/paddle/phi/infermeta/binary.cc @@ -561,7 +561,7 @@ void ConvInferMeta(const MetaTensor& input, strides.size() + 2U, phi::errors::InvalidArgument( "The difference of input's dimension and Attr(strides)'s " - "length must be euqal to 2 for Op(Conv). " + "length must be equal to 2 for Op(Conv). " "But received: input's dimension is %d, input's shape is [%s]; " "Attr(stride)'s length is %d, Attr(stride) is [%s]; " "difference of input's dimention and Attr(strides)'s length = %u.", @@ -732,7 +732,7 @@ void ConvTransposeInferMeta(const MetaTensor& x, 2U, errors::InvalidArgument( "The input's dimension size minus Attr(stride)'s size must " - "be euqal to 2 for Op(conv_transpose). But received: [%d], the " + "be equal to 2 for Op(conv_transpose). But received: [%d], the " "input's dimension size is [%d], the shape of input " "is [%s], the Attr(stride)'s size is [%d].", in_sub_stride_size, diff --git a/paddle/phi/infermeta/fusion.cc b/paddle/phi/infermeta/fusion.cc index ada895fc28d92a..2182640ddbb2f7 100644 --- a/paddle/phi/infermeta/fusion.cc +++ b/paddle/phi/infermeta/fusion.cc @@ -390,7 +390,7 @@ void Conv2dXPUInferMeta(const MetaTensor& x, strides.size() + 2U, phi::errors::InvalidArgument( "The difference of input's dimension and Attr(strides)'s " - "length must be euqal to 2 for Op(Conv_xpu). " + "length must be equal to 2 for Op(Conv_xpu). " "But received: input's dimension is %d, input's shape is [%s]; " "Attr(stride)'s length is %d, Attr(stride) is [%s]; " "difference of input's dimention and Attr(strides)'s length = %u.", @@ -2005,7 +2005,7 @@ void ConvTransposeXPUInferMeta(const MetaTensor& x, 2U, errors::InvalidArgument( "The input's dimension size minus Attr(stride)'s size must " - "be euqal to 2 for Op(conv_transpose). But received: [%d], the " + "be equal to 2 for Op(conv_transpose). But received: [%d], the " "input's dimension size is [%d], the shape of input " "is [%s], the Attr(stride)'s size is [%d].", in_sub_stride_size, diff --git a/paddle/phi/infermeta/multiary.cc b/paddle/phi/infermeta/multiary.cc index 36faa875fbe19b..4caf2cc8ac608e 100644 --- a/paddle/phi/infermeta/multiary.cc +++ b/paddle/phi/infermeta/multiary.cc @@ -2836,7 +2836,7 @@ void LLMInt8LinearInferMeta(const MetaTensor& x, x_dims[x_dims.size() - 1], w_dims[1], errors::InvalidArgument( - "Input(X) dim[-1] and Input(Weight) dim[1] should be euqal." + "Input(X) dim[-1] and Input(Weight) dim[1] should be equal." "But received Input(X) dim[-1](%s) != Input(Weight) dim[1](%s)", x_dims[x_dims.size() - 1], w_dims[1])); @@ -2856,7 +2856,7 @@ void LLMInt8LinearInferMeta(const MetaTensor& x, weight_scale.dims()[0], w_dims[0], errors::InvalidArgument( - "Input(weight_scale) dim[0] and Input(Weight) dim[0] should be euqal." + "Input(weight_scale) dim[0] and Input(Weight) dim[0] should be equal." "But received Input(weight_scale) dim[0](%s) != Input(Weight) " "dim[0](%s)", weight_scale.dims()[0], @@ -4117,7 +4117,7 @@ void WeightOnlyLinearInferMeta(const MetaTensor& x, x_dims[x_dims.size() - 1], w_dims[1], errors::InvalidArgument( - "Input(X) dim[-1] and Input(Weight) dim[1] should be euqal." + "Input(X) dim[-1] and Input(Weight) dim[1] should be equal." "But received Input(X) dim[-1](%s) != Input(Weight) dim[1](%s)", x_dims[x_dims.size() - 1], w_dims[1])); @@ -4205,7 +4205,7 @@ void YoloLossInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ( dim_x[2], dim_x[3], - phi::errors::InvalidArgument("Input(X) dim[3] and dim[4] should be euqal." + phi::errors::InvalidArgument("Input(X) dim[3] and dim[4] should be equal." "But received dim[3](%s) != dim[4](%s)", dim_x[2], dim_x[3])); diff --git a/paddle/phi/infermeta/unary.cc b/paddle/phi/infermeta/unary.cc index 333c9c393a8180..d208611ca315b3 100644 --- a/paddle/phi/infermeta/unary.cc +++ b/paddle/phi/infermeta/unary.cc @@ -938,7 +938,7 @@ void DirichletInferMeta(const MetaTensor& alpha, MetaTensor* out) { 1, phi::errors::InvalidArgument( "ShapeError: The number of dimensions of 'Alpha' " - "must be greater than or euqal to 1. " + "must be greater than or equal to 1. " "But received Alpha's dimensions = %d,", alpha_dim.size())); out->set_dims(alpha_dim); @@ -3192,7 +3192,7 @@ void PoolInferMeta(const MetaTensor& x, 2U, errors::InvalidArgument( "the dimension of input minus the size of " - "Attr(kernel_size_) must be euqal to 2 in Op(pool). " + "Attr(kernel_size_) must be equal to 2 in Op(pool). " "But received: the dimension of input minus the size " "of Attr(kernel_size_) is %d, the " "input's dimension is %d, the shape of input " diff --git a/paddle/phi/kernels/cpu/conv_util.h b/paddle/phi/kernels/cpu/conv_util.h index 1b83c6d7de59e3..765d0c9b4bdecf 100644 --- a/paddle/phi/kernels/cpu/conv_util.h +++ b/paddle/phi/kernels/cpu/conv_util.h @@ -166,7 +166,7 @@ inline std::vector ComputeOutputShape( strides.size() + 2U, phi::errors::InvalidArgument( "The difference of input's dimension and Attr(strides)'s " - "length must be euqal to 2 for Op(Conv). " + "length must be equal to 2 for Op(Conv). " "But received: input's dimension is %d, input's shape is [%s]; " "Attr(stride)'s length is %d, Attr(stride) is [%s]; " "difference of input's dimension and Attr(strides)'s length = %u.", diff --git a/paddle/phi/kernels/fusion/cutlass/memory_efficient_attention_grad_kernel.cu b/paddle/phi/kernels/fusion/cutlass/memory_efficient_attention_grad_kernel.cu index 2dd5334548f6a5..c72a1b69e7ef82 100644 --- a/paddle/phi/kernels/fusion/cutlass/memory_efficient_attention_grad_kernel.cu +++ b/paddle/phi/kernels/fusion/cutlass/memory_efficient_attention_grad_kernel.cu @@ -65,7 +65,7 @@ void MemoryEfficientAttentionGradKernel( output_grad.dims().size(), phi::errors::InvalidArgument( "The size of query's dimensions " - "should be euqal to output grad. But received query's " + "should be equal to output grad. But received query's " "dimensions = %d, output grad's dimensions = %d.", query.dims().size(), output_grad.dims().size())); @@ -73,7 +73,7 @@ void MemoryEfficientAttentionGradKernel( key.dims().size(), phi::errors::InvalidArgument( "The size of query's dimensions " - "should be euqal to key. But received query's " + "should be equal to key. But received query's " "dimensions = %d, key's dimensions = %d.", query.dims().size(), key.dims().size())); @@ -81,7 +81,7 @@ void MemoryEfficientAttentionGradKernel( value.dims().size(), phi::errors::InvalidArgument( "The size of query's dimensions " - "should be euqal to value. But received query's " + "should be equal to value. But received query's " "dimensions = %d, value's dimensions = %d.", query.dims().size(), key.dims().size())); @@ -99,7 +99,7 @@ void MemoryEfficientAttentionGradKernel( output_grad.dims()[0], phi::errors::InvalidArgument( "The batch size of query's dimensions " - "should be euqal to output grad. But received query's " + "should be equal to output grad. But received query's " "batch size = %d, output grad's batch size = %d.", query.dims()[0], output_grad.dims()[0])); @@ -107,7 +107,7 @@ void MemoryEfficientAttentionGradKernel( key.dims()[0], phi::errors::InvalidArgument( "The batch size of query's dimensions " - "should be euqal to key. But received query's " + "should be equal to key. But received query's " "batch size = %d, key's batch size = %d.", query.dims()[0], key.dims()[0])); @@ -115,7 +115,7 @@ void MemoryEfficientAttentionGradKernel( value.dims()[0], phi::errors::InvalidArgument( "The batch size of query's dimensions " - "should be euqal to value. But received query's " + "should be equal to value. But received query's " "batch size = %d, value's batch size = %d.", query.dims()[0], value.dims()[0])); @@ -126,7 +126,7 @@ void MemoryEfficientAttentionGradKernel( value.dims()[1], phi::errors::InvalidArgument( "The sequence length of key" - "should be euqal to value. But received key's sequence length = " + "should be equal to value. But received key's sequence length = " "%d, value's sequence length = %d.", key.dims()[1], value.dims()[1])); @@ -134,7 +134,7 @@ void MemoryEfficientAttentionGradKernel( output_grad.dims()[1], phi::errors::InvalidArgument( "The sequence length of query" - "should be euqal to output grad. But received " + "should be equal to output grad. But received " "query's sequence length = " "%d, output grad's sequence length = %d.", query.dims()[1], @@ -146,7 +146,7 @@ void MemoryEfficientAttentionGradKernel( key.dims()[2], phi::errors::InvalidArgument( "The head number of query" - "should be euqal to key. But received query's head number = " + "should be equal to key. But received query's head number = " "%d, key's head number = %d.", query.dims()[2], key.dims()[2])); @@ -155,7 +155,7 @@ void MemoryEfficientAttentionGradKernel( value.dims()[2], phi::errors::InvalidArgument( "The head number of query" - "should be euqal to value. But received query's head number = " + "should be equal to value. But received query's head number = " "%d, value's head number = %d.", query.dims()[2], value.dims()[2])); @@ -163,7 +163,7 @@ void MemoryEfficientAttentionGradKernel( output_grad.dims()[2], phi::errors::InvalidArgument( "The head number of query" - "should be euqal to output grad. But received " + "should be equal to output grad. But received " "query's head number = " "%d, output grad's head number = %d.", query.dims()[2], @@ -175,7 +175,7 @@ void MemoryEfficientAttentionGradKernel( key.dims()[3], phi::errors::InvalidArgument( "The head size of query" - "should be euqal to key. But received query's head size = " + "should be equal to key. But received query's head size = " "%d, key's head size = %d.", query.dims()[3], key.dims()[3])); @@ -184,7 +184,7 @@ void MemoryEfficientAttentionGradKernel( output_grad.dims()[3], phi::errors::InvalidArgument( "The head size of value" - "should be euqal to output grad. But received value's head size = " + "should be equal to output grad. But received value's head size = " "%d, output grad's head size = %d.", value.dims()[3], output_grad.dims()[3])); @@ -237,7 +237,7 @@ void MemoryEfficientAttentionGradKernel( cu_seqlens_q.get().dims()[0], cu_seqlens_k.get().dims()[0], phi::errors::InvalidArgument("The first dimension of cu_seqlens_q" - "should be euqal to cu_seqlens_q.")); + "should be equal to cu_seqlens_q.")); PADDLE_ENFORCE_EQ( q_dims[0], 1, @@ -361,7 +361,7 @@ void MemoryEfficientAttentionGradKernel( query.dims()[0], phi::errors::InvalidArgument( "The first dimension of delta" - "should be euqal to query. But received delta's first dimension = " + "should be equal to query. But received delta's first dimension = " "%d, query's first dimension = %d.", delta.dims()[0], query.dims()[0])); @@ -369,7 +369,7 @@ void MemoryEfficientAttentionGradKernel( query.dims()[2], phi::errors::InvalidArgument( "The second dimension of delta" - "should be euqal to third dimension query. But " + "should be equal to third dimension query. But " "received delta's second dimension = " "%d, query's third dimension = %d.", delta.dims()[1], @@ -378,7 +378,7 @@ void MemoryEfficientAttentionGradKernel( query.dims()[1], phi::errors::InvalidArgument( "The third dimension of delta" - "should be euqal to second dimension query. But " + "should be equal to second dimension query. But " "received delta's third dimension = " "%d, query's second dimension = %d.", delta.dims()[2], @@ -454,19 +454,19 @@ void MemoryEfficientAttentionGradKernel( DimStride(query_grad->dims(), 1), phi::errors::InvalidArgument( "The strideM of grad query" - "should be euqal to the first dimension size of " + "should be equal to the first dimension size of " "query grad's stride")); PADDLE_ENFORCE_EQ(k_dims[2] * k_dims[3], DimStride(key_grad->dims(), 1), phi::errors::InvalidArgument( "The strideM of grad key" - "should be euqal to the first dimension size of key " + "should be equal to the first dimension size of key " "grad's stride")); PADDLE_ENFORCE_EQ(v_dims[2] * v_dims[3], DimStride(value_grad->dims(), 1), phi::errors::InvalidArgument( "The strideM of grad value" - "should be euqal to the first dimension size of " + "should be equal to the first dimension size of " "value grad's stride")); PD_MEA_CHECK_OVERFLOW(p.q_strideB, DimStride(query.dims(), 0));