Skip to content

Commit f5ed87f

Browse files
committed
Fix
1 parent ebdc81d commit f5ed87f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1017
-1004
lines changed

paddle/cinn/adt/igroup.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ std::shared_ptr<IndexExprInferContext> MakeIndexExprInferContext(
3232
.emplace(anchor_iterators->at(i), anchor_iterators->at(i))
3333
.second,
3434
true,
35-
phi::errors::InvalidArgument(
35+
::common::errors::InvalidArgument(
3636
"The element in anchor iterators failed to insert in anchor "
3737
"iterator2value! Please check."));
3838
}

paddle/cinn/adt/igroup.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class IGroup final {
9494
const List<Iterator>& loop_iterators() const {
9595
PADDLE_ENFORCE_EQ(anchor_sd_equation_ctx_.has_value(),
9696
true,
97-
phi::errors::InvalidArgument(
97+
::common::errors::InvalidArgument(
9898
"The anchor_sd_equation_ctx_ has no value."));
9999
return anchor_sd_equation_ctx_.value().sd_iterators();
100100
}
@@ -128,7 +128,7 @@ class IGroup final {
128128
PADDLE_ENFORCE_EQ(
129129
index2tensor->emplace(index, tensor).second,
130130
true,
131-
phi::errors::InvalidArgument(
131+
::common::errors::InvalidArgument(
132132
"The index2tensor map has already contained the index."));
133133
(*tensor2indexes)[tensor].emplace_back(index);
134134
}
@@ -138,7 +138,7 @@ class IGroup final {
138138
PADDLE_ENFORCE_EQ(
139139
index2tensor->emplace(index, tensor).second,
140140
true,
141-
phi::errors::InvalidArgument(
141+
::common::errors::InvalidArgument(
142142
"The index2tensor map has already contained the index."));
143143
(*tensor2indexes)[tensor].emplace_back(index);
144144
}

paddle/cinn/adt/naive_bidirection_equation_generator.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ OpArgIndexes<std::optional<Index>> MakeOutMsgOpArgIndexes(
5353
for (const auto& out_msg_in_index : *opt_out_msg_in_indexes) {
5454
PADDLE_ENFORCE_EQ(out_msg_in_index.has_value(),
5555
true,
56-
phi::errors::InvalidArgument(
56+
::common::errors::InvalidArgument(
5757
"The out_msg_in_index should have value."));
5858
out_msg_in_indexes->emplace_back(out_msg_in_index.value());
5959
}
@@ -118,7 +118,7 @@ void NaiveBidirectionEquationGenerator::InitInMsgIndex2OutMsgIndex() {
118118
this->in_msg_index2out_msg_index_.emplace(in_index, out_index)
119119
.second,
120120
true,
121-
phi::errors::InvalidArgument(
121+
::common::errors::InvalidArgument(
122122
"The out_msg_index2in_msg_index_ map has already "
123123
"contained the out_index."));
124124
});
@@ -172,7 +172,7 @@ NaiveBidirectionEquationGenerator::MakeGetterOpStmt4OpPlaceHolder() const {
172172
->emplace(fake_op_placeholders_->at(i), op_stmts_->at(i))
173173
.second,
174174
true,
175-
phi::errors::InvalidArgument(
175+
::common::errors::InvalidArgument(
176176
"The fake_op_placeholder2op_stmt map has already contained the "
177177
"fake_op_placeholder."));
178178
}

paddle/cinn/adt/schedule_mesh.cc

+10-10
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ ScheduleMesh MeshReshape(const ScheduleMesh& sched_mesh,
388388
PADDLE_ENFORCE_EQ(
389389
dim.Has<std::int64_t>(),
390390
true,
391-
phi::errors::InvalidArgument(
391+
::common::errors::InvalidArgument(
392392
"Each dimension in 'origin_shape' must have an int64_t value."));
393393
origin_numel *= dim.Get<std::int64_t>();
394394
}
@@ -397,21 +397,21 @@ ScheduleMesh MeshReshape(const ScheduleMesh& sched_mesh,
397397
bool dynamic_shape = false;
398398
for (const auto& dim : shape) {
399399
if (dim < 0) {
400-
PADDLE_ENFORCE_EQ(
401-
dim == -1 && !dynamic_shape,
402-
true,
403-
phi::errors::InvalidArgument("Negative dimension in 'shape' must be "
404-
"-1 to represent dynamic shape. "
405-
"But received: %d",
406-
dim));
400+
PADDLE_ENFORCE_EQ(dim == -1 && !dynamic_shape,
401+
true,
402+
::common::errors::InvalidArgument(
403+
"Negative dimension in 'shape' must be "
404+
"-1 to represent dynamic shape. "
405+
"But received: %d",
406+
dim));
407407
dynamic_shape = true;
408408
} else {
409409
numel *= dim;
410410
}
411411
}
412412
PADDLE_ENFORCE_EQ(dynamic_shape || numel == origin_numel,
413413
true,
414-
phi::errors::InvalidArgument(
414+
::common::errors::InvalidArgument(
415415
"The total number of elements must match between "
416416
"'shape' and 'origin_shape' "
417417
"unless there is a dynamic shape. "
@@ -485,7 +485,7 @@ ScheduleMesh MeshPaddingRoundUp(
485485
PADDLE_ENFORCE_EQ(
486486
shape->at(i).Has<std::int64_t>(),
487487
true,
488-
phi::errors::InvalidArgument(
488+
::common::errors::InvalidArgument(
489489
"Each dimension in 'shape' must have an int64_t value. "
490490
"But the dimension at index %d does not.",
491491
i));

paddle/cinn/backends/function_prototype.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ void FunctionProto::CheckValid() {
9494
PADDLE_ENFORCE_EQ(
9595
!mutable_arg_types.empty(),
9696
true,
97-
phi::errors::InvalidArgument(
97+
::common::errors::InvalidArgument(
9898
"A void function should have at least one mutable argument to "
9999
"output something."));
100100
} else {
101101
PADDLE_ENFORCE_EQ(
102102
mutable_arg_types.empty(),
103103
true,
104-
phi::errors::InvalidArgument(
104+
::common::errors::InvalidArgument(
105105
"A function with return should not have mutable argument."));
106106
}
107107
}
@@ -115,7 +115,7 @@ FunctionProto::shape_inference_t FunctionProto::ShapeFollowNthArgument(int n) {
115115
auto x = args[n].as_tensor();
116116
PADDLE_ENFORCE_NOT_NULL(
117117
x,
118-
phi::errors::InvalidArgument(
118+
::common::errors::InvalidArgument(
119119
"The argument at index (%d) must be a tensor.", n));
120120
return x->shape;
121121
};

paddle/cinn/backends/llvm/llvm_intrin_rule.h

+41-41
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,29 @@ inline void MakeFloatIntrinOp(lang::Args args, lang::RetValue *rv) {
3535
PADDLE_ENFORCE_GE(
3636
args.size(),
3737
1U,
38-
phi::errors::InvalidArgument(
38+
::common::errors::InvalidArgument(
3939
"The number of arguments should be at least 1. Received: %d",
4040
args.size()));
4141

4242
Expr arg = args[0];
4343
ir::Call *node = arg->as<ir::Call>();
4444

4545
PADDLE_ENFORCE_NOT_NULL(node,
46-
phi::errors::InvalidArgument(
46+
::common::errors::InvalidArgument(
4747
"The argument must be a valid call expression."));
4848

4949
PADDLE_ENFORCE_GE(
5050
node->read_args.size(),
5151
arg_nums,
52-
phi::errors::InvalidArgument(
52+
::common::errors::InvalidArgument(
5353
"The number of read arguments should be at least %d. Received: %d",
5454
arg_nums,
5555
node->read_args.size()));
5656

5757
if (add_float_suffix) {
5858
PADDLE_ENFORCE_EQ(node->type().is_float(),
5959
true,
60-
phi::errors::InvalidArgument(
60+
::common::errors::InvalidArgument(
6161
"The node type should be float. Received: %s",
6262
node->type().to_string().c_str()));
6363
*rv = ir::intrinsics::BuiltinIntrin::Make(
@@ -114,12 +114,12 @@ void RegisterCpuIntrinRule() {
114114
ir::Call *node = arg0->as<ir::Call>();
115115
PADDLE_ENFORCE_NOT_NULL(
116116
node,
117-
phi::errors::InvalidArgument(
117+
::common::errors::InvalidArgument(
118118
"The argument must be a valid call expression."));
119119
PADDLE_ENFORCE_EQ(
120120
!node->read_args.empty(),
121121
true,
122-
phi::errors::InvalidArgument(
122+
::common::errors::InvalidArgument(
123123
"The read_args of the node should not be empty."));
124124

125125
Expr arg = node->read_args[0];
@@ -134,13 +134,13 @@ void RegisterCpuIntrinRule() {
134134
"The number of args should be greater than 1."));
135135
Expr arg0 = args[0];
136136
ir::Call *node = arg0->as<ir::Call>();
137-
PADDLE_ENFORCE_NOT_NULL(
138-
node,
139-
phi::errors::InvalidArgument("The argument must be a valid call "
140-
"expression. Received null."));
137+
PADDLE_ENFORCE_NOT_NULL(node,
138+
::common::errors::InvalidArgument(
139+
"The argument must be a valid call "
140+
"expression. Received null."));
141141
PADDLE_ENFORCE_EQ(!node->read_args.empty(),
142142
true,
143-
phi::errors::InvalidArgument(
143+
::common::errors::InvalidArgument(
144144
"The read_args of the node should not be empty. "
145145
"The provided read_args are empty."));
146146

@@ -162,13 +162,13 @@ void RegisterCpuIntrinRule() {
162162
"The number of args should be greater than 1."));
163163
Expr arg0 = args[0];
164164
ir::Call *node = arg0->as<ir::Call>();
165-
PADDLE_ENFORCE_NOT_NULL(
166-
node,
167-
phi::errors::InvalidArgument("The argument must be a valid call "
168-
"expression. Received null."));
165+
PADDLE_ENFORCE_NOT_NULL(node,
166+
::common::errors::InvalidArgument(
167+
"The argument must be a valid call "
168+
"expression. Received null."));
169169
PADDLE_ENFORCE_EQ(!node->read_args.empty(),
170170
true,
171-
phi::errors::InvalidArgument(
171+
::common::errors::InvalidArgument(
172172
"The read_args of the node should not be empty. "
173173
"Received empty read_args."));
174174

@@ -184,13 +184,13 @@ void RegisterCpuIntrinRule() {
184184
"The number of args should be greater than 1."));
185185
Expr arg0 = args[0];
186186
ir::Call *node = arg0->as<ir::Call>();
187-
PADDLE_ENFORCE_NOT_NULL(
188-
node,
189-
phi::errors::InvalidArgument("The argument must be a valid call "
190-
"expression. Received null."));
187+
PADDLE_ENFORCE_NOT_NULL(node,
188+
::common::errors::InvalidArgument(
189+
"The argument must be a valid call "
190+
"expression. Received null."));
191191
PADDLE_ENFORCE_EQ(!node->read_args.empty(),
192192
true,
193-
phi::errors::InvalidArgument(
193+
::common::errors::InvalidArgument(
194194
"The read_args of the node should not be empty. "
195195
"Received empty read_args."));
196196

@@ -207,13 +207,13 @@ void RegisterCpuIntrinRule() {
207207
"The number of args should be greater than 1."));
208208
Expr arg0 = args[0];
209209
ir::Call *node = arg0->as<ir::Call>();
210-
PADDLE_ENFORCE_NOT_NULL(
211-
node,
212-
phi::errors::InvalidArgument("The argument must be a valid call "
213-
"expression. Received null."));
210+
PADDLE_ENFORCE_NOT_NULL(node,
211+
::common::errors::InvalidArgument(
212+
"The argument must be a valid call "
213+
"expression. Received null."));
214214
PADDLE_ENFORCE_EQ(!node->read_args.empty(),
215215
true,
216-
phi::errors::InvalidArgument(
216+
::common::errors::InvalidArgument(
217217
"The read_args of the node should not be empty. "
218218
"Received empty read_args."));
219219

@@ -229,13 +229,13 @@ void RegisterCpuIntrinRule() {
229229
"The number of args should be greater than 1."));
230230
Expr arg0 = args[0];
231231
ir::Call *node = arg0->as<ir::Call>();
232-
PADDLE_ENFORCE_NOT_NULL(
233-
node,
234-
phi::errors::InvalidArgument("The argument must be a valid call "
235-
"expression. Received null."));
232+
PADDLE_ENFORCE_NOT_NULL(node,
233+
::common::errors::InvalidArgument(
234+
"The argument must be a valid call "
235+
"expression. Received null."));
236236
PADDLE_ENFORCE_EQ(!node->read_args.empty(),
237237
true,
238-
phi::errors::InvalidArgument(
238+
::common::errors::InvalidArgument(
239239
"The read_args of the node should not be empty. "
240240
"Received empty read_args."));
241241

@@ -261,13 +261,13 @@ void RegisterCpuIntrinRule() {
261261
"The number of args should be greater than 1."));
262262
Expr arg0 = args[0];
263263
ir::Call *node = arg0->as<ir::Call>();
264-
PADDLE_ENFORCE_NOT_NULL(
265-
node,
266-
phi::errors::InvalidArgument("The argument must be a valid call "
267-
"expression. Received null."));
264+
PADDLE_ENFORCE_NOT_NULL(node,
265+
::common::errors::InvalidArgument(
266+
"The argument must be a valid call "
267+
"expression. Received null."));
268268
PADDLE_ENFORCE_EQ(!node->read_args.empty(),
269269
true,
270-
phi::errors::InvalidArgument(
270+
::common::errors::InvalidArgument(
271271
"The read_args of the node should not be empty. "
272272
"Received empty read_args."));
273273

@@ -284,13 +284,13 @@ void RegisterCpuIntrinRule() {
284284
"The number of args should be greater than 1."));
285285
Expr arg0 = args[0];
286286
ir::Call *node = arg0->as<ir::Call>();
287-
PADDLE_ENFORCE_NOT_NULL(
288-
node,
289-
phi::errors::InvalidArgument("The argument must be a valid call "
290-
"expression. Received null."));
287+
PADDLE_ENFORCE_NOT_NULL(node,
288+
::common::errors::InvalidArgument(
289+
"The argument must be a valid call "
290+
"expression. Received null."));
291291
PADDLE_ENFORCE_EQ(!node->read_args.empty(),
292292
true,
293-
phi::errors::InvalidArgument(
293+
::common::errors::InvalidArgument(
294294
"The read_args of the node should not be empty. "
295295
"Received empty read_args."));
296296

paddle/cinn/backends/llvm/simple_jit.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void SimpleJIT::AddModule(std::unique_ptr<llvm::Module> module, bool optimize) {
5252
PADDLE_ENFORCE_EQ(
5353
!llvm::verifyModule(*module, &llvm::errs()),
5454
true,
55-
phi::errors::InvalidArgument(
55+
::common::errors::InvalidArgument(
5656
"Transformation resulted in an invalid module\n\nmodule:\n"));
5757

5858
bool debug = false;
@@ -102,8 +102,8 @@ SimpleJIT::SimpleJIT() : context_(std::make_unique<llvm::LLVMContext>()) {
102102
llvm::InitializeAllAsmPrinters();
103103

104104
jit_ = llvm::cantFail(llvm::orc::LLJITBuilder().create());
105-
PADDLE_ENFORCE_NOT_NULL(jit_,
106-
phi::errors::InvalidArgument("JIT creation failed."));
105+
PADDLE_ENFORCE_NOT_NULL(
106+
jit_, ::common::errors::InvalidArgument("JIT creation failed."));
107107

108108
auto proc_symbols_generator = llvm::cantFail(
109109
llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(
@@ -135,7 +135,7 @@ void SimpleJIT::Link(ir::Module module, bool optimize) {
135135

136136
PADDLE_ENFORCE_EQ(!llvm::verifyModule(*m, &llvm::errs()),
137137
true,
138-
phi::errors::InvalidArgument("Invalid module found."));
138+
::common::errors::InvalidArgument("Invalid module found."));
139139

140140
AddModule(std::move(m), optimize);
141141
}

0 commit comments

Comments
 (0)