Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Simbolic Symbolic #60923

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions paddle/cinn/adt/equation_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ bool IsReplicatedSymbolicValues(const Value& lhs, const Value& rhs) {
rhs.variant());
}

bool HasReplicatedSimbolicValues(const List<Value>& values) {
bool HasReplicatedSymbolicValues(const List<Value>& 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))) {
Expand All @@ -128,7 +128,7 @@ std::unordered_map<Variable, Value> 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<DimExpr> dim_constants{};
Expand Down
4 changes: 2 additions & 2 deletions paddle/cinn/adt/graph_symbolic_dim_infer_ctx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions paddle/cinn/adt/print_utils/print_schedule_mesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion paddle/cinn/adt/print_utils/print_schedule_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion paddle/cinn/api/op_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class OpGroup {
// Example: Get the all Reduction op_nodes in the group.
// OpGroup group = ...;
// std::set<api::OpNode> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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<void (*)(void**, int32_t)>(
backend_compier_->Lookup(func_name));
backend_compiler_->Lookup(func_name));
return test_func_ptr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class TestAutoGenRuleBase : public ::testing::Test {
protected:
cinn::common::Target target_;
std::vector<ir::LoweredFunc> lowered_funcs_;
std::unique_ptr<backends::Compiler> backend_compier_;
std::unique_ptr<backends::Compiler> backend_compiler_;
};

/* @brief: Interface for checking function correctness.
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/auto_schedule/search_space/search_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down