From 0a3031dd8515f1df4ef705bca812056204a4c35a Mon Sep 17 00:00:00 2001 From: co63oc Date: Thu, 18 Jan 2024 08:48:13 +0800 Subject: [PATCH 1/2] Fix --- paddle/cinn/adt/equation_solver.cc | 4 ++-- paddle/cinn/adt/graph_symbolic_dim_infer_ctx.cc | 4 ++-- paddle/cinn/adt/print_utils/print_schedule_mesh.cc | 4 ++-- paddle/cinn/adt/print_utils/print_schedule_mesh.h | 2 +- paddle/cinn/api/op_group.h | 2 +- .../search_space/auto_gen_rule/test_helper.cc | 8 ++++---- paddle/cinn/auto_schedule/search_space/search_space.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/paddle/cinn/adt/equation_solver.cc b/paddle/cinn/adt/equation_solver.cc index 7a3d67312c63b..4e1d5b71e93b3 100644 --- a/paddle/cinn/adt/equation_solver.cc +++ b/paddle/cinn/adt/equation_solver.cc @@ -109,7 +109,7 @@ bool IsReplicatedSymbolicValues(const Value& lhs, const Value& rhs) { rhs.variant()); } -bool HasReplicatedSimbolicValues(const List& values) { +bool HasReplicatedSymbolicValues(const List& values) { for (std::size_t i = 0; i < values->size(); ++i) { for (std::size_t j = i + 1; j < values->size(); ++j) { if (IsReplicatedSymbolicValues(values->at(i), values->at(j))) { @@ -128,7 +128,7 @@ std::unordered_map InferValuesImpl( for (const auto& iter : *in_iters.value()) { in_values->emplace_back(ctx->GetValue(iter)); } - if (HasReplicatedSimbolicValues(in_values)) { + if (HasReplicatedSymbolicValues(in_values)) { return {{out_index.value(), Undefined{}}}; } List dim_constants{}; diff --git a/paddle/cinn/adt/graph_symbolic_dim_infer_ctx.cc b/paddle/cinn/adt/graph_symbolic_dim_infer_ctx.cc index 2ff20b9e5d0c9..54006c603a513 100644 --- a/paddle/cinn/adt/graph_symbolic_dim_infer_ctx.cc +++ b/paddle/cinn/adt/graph_symbolic_dim_infer_ctx.cc @@ -475,9 +475,9 @@ SymbolicDim GetOrNewSymbolicDim( const auto& target_symbolic_dim_op = GetSymbolicDimOp4TensorDim(target_tensor_dim, shape_analysis); for (const auto& [tensor_dim, symbolic_dim] : tensor_dim2symbolic_Dim) { - const auto& cur_symblic_dim_op = + const auto& cur_symbolic_dim_op = GetSymbolicDimOp4TensorDim(tensor_dim, shape_analysis); - if (target_symbolic_dim_op == cur_symblic_dim_op) { + if (target_symbolic_dim_op == cur_symbolic_dim_op) { return symbolic_dim; } } diff --git a/paddle/cinn/adt/print_utils/print_schedule_mesh.cc b/paddle/cinn/adt/print_utils/print_schedule_mesh.cc index edaea573b7311..dbc65532e823b 100644 --- a/paddle/cinn/adt/print_utils/print_schedule_mesh.cc +++ b/paddle/cinn/adt/print_utils/print_schedule_mesh.cc @@ -102,9 +102,9 @@ std::string ToTxtStringMeshImpl( } // namespace -std::string ToTxtString(const ScheduleMesh& schecule_mesh) { +std::string ToTxtString(const ScheduleMesh& schedule_mesh) { return std::visit([&](const auto& impl) { return ToTxtStringMeshImpl(impl); }, - schecule_mesh.variant()); + schedule_mesh.variant()); } } // namespace cinn::adt diff --git a/paddle/cinn/adt/print_utils/print_schedule_mesh.h b/paddle/cinn/adt/print_utils/print_schedule_mesh.h index af4ae55ed98c4..2fa77929e76f0 100644 --- a/paddle/cinn/adt/print_utils/print_schedule_mesh.h +++ b/paddle/cinn/adt/print_utils/print_schedule_mesh.h @@ -20,6 +20,6 @@ namespace cinn::adt { class ScheduleMesh; -std::string ToTxtString(const ScheduleMesh& schecule_mesh); +std::string ToTxtString(const ScheduleMesh& schedule_mesh); } // namespace cinn::adt diff --git a/paddle/cinn/api/op_group.h b/paddle/cinn/api/op_group.h index 7e9a2581a9535..fc9c9d95213de 100644 --- a/paddle/cinn/api/op_group.h +++ b/paddle/cinn/api/op_group.h @@ -149,7 +149,7 @@ class OpGroup { // Example: Get the all Reduction op_nodes in the group. // OpGroup group = ...; // std::set reduce_ op_set; - // // The lambda funtion of VisitOpNode to get reduction op_nodes. + // // The lambda function of VisitOpNode to get reduction op_nodes. // auto get_reduce_op = [&reduce_op_set](const api::OpNode& op){ // if (op.kind() == OpPatternKind::kReduction) { // reduce_op_set.insert(op); diff --git a/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.cc b/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.cc index 257fb1a6a935d..67d4c4ae3a0f7 100644 --- a/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.cc +++ b/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.cc @@ -43,7 +43,7 @@ using ::cinn::hlir::framework::Tensor; void TestAutoGenRuleBase::Initialize(const cinn::common::Target& target) { target_ = target; - backend_compier_ = backends::Compiler::Create(target); + backend_compiler_ = backends::Compiler::Create(target); } ir::IRSchedule TestAutoGenRuleBase::MakeIRSchedule( @@ -92,7 +92,7 @@ ir::Module TestAutoGenRuleBase::BuildIRModule(const ir::IRSchedule& schedule) { CHECK_EQ(lowered_funcs_.size(), updated_bodys.size()) << "associated exprs size not equal"; - ir::Module::Builder builder("test_bulder", this->target_); + ir::Module::Builder builder("test_builder", this->target_); for (int i = 0; i < lowered_funcs_.size(); ++i) { ir::Expr func_body = updated_bodys.at(i); const ir::LoweredFunc& ori_func = lowered_funcs_.at(i); @@ -124,9 +124,9 @@ raw_func_type TestAutoGenRuleBase::GenExecutableKernel( const ir::Module& ir_module) { auto&& func_name = lowered_funcs_.front()->name; // Compile to machine code - backend_compier_->Build(ir_module); + backend_compiler_->Build(ir_module); auto test_func_ptr = reinterpret_cast( - backend_compier_->Lookup(func_name)); + backend_compiler_->Lookup(func_name)); return test_func_ptr; } diff --git a/paddle/cinn/auto_schedule/search_space/search_space.h b/paddle/cinn/auto_schedule/search_space/search_space.h index f8f3907ed9710..88452bcd7ba25 100644 --- a/paddle/cinn/auto_schedule/search_space/search_space.h +++ b/paddle/cinn/auto_schedule/search_space/search_space.h @@ -43,7 +43,7 @@ class SearchSpace { SearchSpace(const TuneTask& tune_task, utils::LinearRandomEngine::StateType rand_seed = -1); - // Sketch mutate, returns the mutated ModuleExpr and estimited cost + // Sketch mutate, returns the mutated ModuleExpr and estimated cost virtual SearchState GetScheduleMutate(const SearchState& state, const ExprCostModel& cost_model); From a127e5ce858a4a79df1784e8bd4bd81ac14a005d Mon Sep 17 00:00:00 2001 From: co63oc Date: Thu, 18 Jan 2024 10:09:22 +0800 Subject: [PATCH 2/2] Fix --- .../cinn/auto_schedule/search_space/auto_gen_rule/test_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.h b/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.h index b808c046b752c..d23a8ab0a2da2 100644 --- a/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.h +++ b/paddle/cinn/auto_schedule/search_space/auto_gen_rule/test_helper.h @@ -70,7 +70,7 @@ class TestAutoGenRuleBase : public ::testing::Test { protected: cinn::common::Target target_; std::vector lowered_funcs_; - std::unique_ptr backend_compier_; + std::unique_ptr backend_compiler_; }; /* @brief: Interface for checking function correctness.