Skip to content

Commit c585dcc

Browse files
authored
Fix euqal equal (#61009)
1 parent c68d6b7 commit c585dcc

15 files changed

Lines changed: 47 additions & 47 deletions

File tree

paddle/cinn/ir/schedule/schedule_desc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace ir {
3131
// records all transform/getting operations executed by a corresponding
3232
// ir::IRSchedule. A ScheduleDesc can be serialized to JSON format and saved to
3333
// file. For deserializing, it can be re-applied to a new IRSchedule that is
34-
// initialzied by a semantics-euqal original ir::ModuleExpr, and then achieves
34+
// initialzied by a semantics-equal original ir::ModuleExpr, and then achieves
3535
// the same result.
3636

3737
class IRSchedule; // forward declartion to avoid cross-reference
@@ -78,7 +78,7 @@ class ScheduleDesc {
7878

7979
/**
8080
* \brief Replay this description to a new IRSchedule that is initialzied by a
81-
* semantics-euqal original ModuleExpr.
81+
* semantics-equal original ModuleExpr.
8282
* @param schedule The original IRSchedule to be replayed the description on.
8383
* @param without_post_schedule Determine whether to delete the post
8484
* schedules.

paddle/cinn/ir/test/ir_compare_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ TEST(TestIrCompare, SingleFunction) {
132132
ASSERT_TRUE(IRCompare(funcs_1.front(), funcs_2.front()));
133133
// compare with itself
134134
ASSERT_TRUE(IRCompare(funcs_1.front(), funcs_1.front()));
135-
// they are euqal if allowing suffix of name different
135+
// they are equal if allowing suffix of name different
136136
ASSERT_TRUE(IRCompare(funcs_1.front(), funcs_2.front(), true));
137137

138138
ASSERT_FALSE(IRCompare(funcs_1.front(), funcs_3.front()));

paddle/cinn/ir/test/schedule_desc_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ std::string SourceCodeGen(const ModuleExpr& module_expr,
105105
const std::vector<ir::LoweredFunc>& lowered_funcs,
106106
const Target& target) {
107107
auto exprs = module_expr.GetExprs();
108-
CHECK_EQ(exprs.size(), lowered_funcs.size()) << "size of func is not euqal";
108+
CHECK_EQ(exprs.size(), lowered_funcs.size()) << "size of func is not equal";
109109
std::vector<ir::LoweredFunc> updated_funcs =
110110
ir::ir_utils::IRCopy(lowered_funcs);
111111
Module::Builder builder("test_module", target);

paddle/cinn/ir/utils/ir_compare.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ bool IrEqualVisitor::Compare(const std::string& lhs, const std::string& rhs) {
7676
}
7777

7878
if (!equal) {
79-
VLOG(5) << "Not euqal on name, lhs=" << lhs << ", rhs=" << rhs;
79+
VLOG(5) << "Not equal on name, lhs=" << lhs << ", rhs=" << rhs;
8080
}
8181

8282
return equal;

paddle/cinn/ir/utils/ir_compare.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ namespace cinn {
2222
namespace ir {
2323
namespace ir_utils {
2424

25-
// Determine whether two ir AST trees are euqal by comparing their struct and
25+
// Determine whether two ir AST trees are equal by comparing their struct and
2626
// fields of each node through dfs visitor
2727
class IrEqualVisitor : public IRVisitorRequireReImpl<bool, const Expr*> {
2828
public:
2929
explicit IrEqualVisitor(bool allow_name_suffix_diff = false,
3030
bool only_compare_structure = false)
3131
: allow_name_suffix_diff_(allow_name_suffix_diff),
3232
only_compare_structure_(only_compare_structure) {}
33-
// Return true if they are euqal, otherwise false;
33+
// Return true if they are equal, otherwise false;
3434
bool Compare(const Expr& lhs, const Expr& rhs);
3535

3636
private:

paddle/fluid/framework/fleet/ps_gpu_wrapper.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ void PSGPUWrapper::PreBuildTask(std::shared_ptr<HeterContext> gpu_task,
386386
for (size_t i = 0; i < keys_vec.size(); ++i) {
387387
if (!infer_mode_ || sage_mode_) {
388388
CHECK_EQ(keys_vec[i]->size(), ranks_vec[i]->size())
389-
<< keys_vec[i]->size() << " should be euqal to "
389+
<< keys_vec[i]->size() << " should be equal to "
390390
<< ranks_vec[i]->size();
391391
for (size_t j = 0; j < keys_vec[i]->size(); ++j) {
392392
auto& key = (*keys_vec[i])[j];
@@ -398,7 +398,7 @@ void PSGPUWrapper::PreBuildTask(std::shared_ptr<HeterContext> gpu_task,
398398
}
399399
} else {
400400
CHECK_EQ(ranks_vec[i]->size(), 0UL)
401-
<< ranks_vec[i]->size() << " should be euqal to 0";
401+
<< ranks_vec[i]->size() << " should be equal to 0";
402402
for (size_t j = 0; j < keys_vec[i]->size(); ++j) {
403403
auto& key = (*keys_vec[i])[j];
404404
int shard_idx = key % thread_keys_thread_num_;

paddle/fluid/pir/transforms/inplace_pass.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bool CanDoInplace(const std::unordered_set<pir::Value>& eager_dels,
9191
return true;
9292
}
9393

94-
auto is_numel_euqal = [](const TensorType& in,
94+
auto is_numel_equal = [](const TensorType& in,
9595
const TensorType& out) -> bool {
9696
int64_t in_numel = 1;
9797
int64_t out_numel = 1;
@@ -127,7 +127,7 @@ bool CanDoInplace(const std::unordered_set<pir::Value>& eager_dels,
127127
};
128128
// In this version, we don't consider the -1 in ddim, we just calculate the
129129
// result.
130-
auto is_numel_euqal_loose_version = [](const TensorType& in,
130+
auto is_numel_equal_loose_version = [](const TensorType& in,
131131
const TensorType& out) -> bool {
132132
auto calculate_numel = [](const phi::DDim& ddim) -> int64_t {
133133
int64_t numel = 1;
@@ -144,10 +144,10 @@ bool CanDoInplace(const std::unordered_set<pir::Value>& eager_dels,
144144
bool equal = false;
145145
bool relax = (RelaxShapeCheckOps.count(op_name) > 0);
146146
if (relax) {
147-
equal = is_numel_euqal_loose_version(input_alloc_tensor_type,
147+
equal = is_numel_equal_loose_version(input_alloc_tensor_type,
148148
output_alloc_tensor_type);
149149
} else {
150-
equal = is_numel_euqal(input_alloc_tensor_type, output_alloc_tensor_type);
150+
equal = is_numel_equal(input_alloc_tensor_type, output_alloc_tensor_type);
151151
}
152152

153153
if (!equal) {
@@ -159,7 +159,7 @@ bool CanDoInplace(const std::unordered_set<pir::Value>& eager_dels,
159159
return false;
160160
}
161161
if (eager_dels.count(input) == 0) {
162-
VLOG(9) << " -- input not in eager_deletion_valus, can't do inplace";
162+
VLOG(9) << " -- input not in eager_deletion_vars, can't do inplace";
163163
return false;
164164
}
165165
return true;

paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static bool NeedFallBackFromGPUDNN2GPU(pir::Operation* op,
190190
const std::string& kernel_name,
191191
const phi::KernelKey kernel_key) {
192192
// NOTE(phlrain): keep the same kernel select strategy with
193-
// GetExepectKernelKey
193+
// GetExpectKernelKey
194194
if (op->isa<Pool2dOp>() || op->isa<Pool2dGradOp>() || op->isa<Pool3dOp>() ||
195195
op->isa<Pool3dGradOp>()) {
196196
if (kernel_key.backend() == phi::Backend::GPUDNN &&

paddle/fluid/pir/transforms/transform_general_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Operation* GetDefiningOpForInput(const Operation* op, uint32_t index);
6767
* @brief Get operations and the index of designative op operand (op result)
6868
that use the specific output of the operation.
6969
*
70-
* @param const Operation* cosnt pointer to an operation
70+
* @param const Operation* const pointer to an operation
7171
* @param uint32_t index of result of the operation
7272
7373
* @return std::vector<std::pair<Operation*, int32_t>>

paddle/phi/infermeta/binary.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ void ConvInferMeta(const MetaTensor& input,
561561
strides.size() + 2U,
562562
phi::errors::InvalidArgument(
563563
"The difference of input's dimension and Attr(strides)'s "
564-
"length must be euqal to 2 for Op(Conv). "
564+
"length must be equal to 2 for Op(Conv). "
565565
"But received: input's dimension is %d, input's shape is [%s]; "
566566
"Attr(stride)'s length is %d, Attr(stride) is [%s]; "
567567
"difference of input's dimention and Attr(strides)'s length = %u.",
@@ -732,7 +732,7 @@ void ConvTransposeInferMeta(const MetaTensor& x,
732732
2U,
733733
errors::InvalidArgument(
734734
"The input's dimension size minus Attr(stride)'s size must "
735-
"be euqal to 2 for Op(conv_transpose). But received: [%d], the "
735+
"be equal to 2 for Op(conv_transpose). But received: [%d], the "
736736
"input's dimension size is [%d], the shape of input "
737737
"is [%s], the Attr(stride)'s size is [%d].",
738738
in_sub_stride_size,

0 commit comments

Comments
 (0)