Skip to content

Commit 7cccca9

Browse files
authored
[PIR] Change log level of op verify (#73268)
1 parent 8d62e92 commit 7cccca9

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

paddle/fluid/pir/dialect/distributed/ir/dist_op.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ void VerifyOpArgNum(const pir::OpBase* op,
4343
size_t num_outputs,
4444
size_t op_dist_attr_ninputs,
4545
size_t op_dist_attr_noutputs) {
46-
VLOG(4) << "Start Verifying inputs, outputs and attributes for: "
46+
VLOG(6) << "Start Verifying inputs, outputs and attributes for: "
4747
<< T::name();
48-
VLOG(4) << "Verifying inputs num:";
48+
VLOG(6) << "Verifying inputs num:";
4949
{
5050
auto input_size = op->num_operands();
5151
PADDLE_ENFORCE_EQ(input_size,
@@ -57,7 +57,7 @@ void VerifyOpArgNum(const pir::OpBase* op,
5757
input_size));
5858
}
5959

60-
VLOG(4) << "Verifying outputs num:";
60+
VLOG(6) << "Verifying outputs num:";
6161
{
6262
auto output_size = op->num_results();
6363
PADDLE_ENFORCE_EQ(output_size,
@@ -69,7 +69,7 @@ void VerifyOpArgNum(const pir::OpBase* op,
6969
output_size));
7070
}
7171

72-
VLOG(4) << "Verifying attributes:";
72+
VLOG(6) << "Verifying attributes:";
7373
{
7474
auto& attributes = op->attributes();
7575
PADDLE_ENFORCE_EQ(
@@ -87,7 +87,7 @@ void VerifyOpArgNum(const pir::OpBase* op,
8787
"Type of attribute: op_dist_attr is not right."));
8888
}
8989

90-
VLOG(4) << "Verifying op dist attrs:";
90+
VLOG(6) << "Verifying op dist attrs:";
9191
{
9292
auto op_dist_attr =
9393
op->attribute<paddle::dialect::OperationDistAttribute>("op_dist_attr");
@@ -103,7 +103,7 @@ void VerifyOpArgNum(const pir::OpBase* op,
103103
"The op_dist_attr output size must be equal to %u.",
104104
op_dist_attr_noutputs));
105105
}
106-
VLOG(4) << "End Verifying inputs, outputs and attributes num for: "
106+
VLOG(6) << "End Verifying inputs, outputs and attributes num for: "
107107
<< T::name();
108108
}
109109

@@ -124,7 +124,7 @@ void ShardTensorOp::VerifySig() {
124124
"Mismatched output type. ShardTensorOp requires "
125125
"'DistDenseTensorType' for output."));
126126

127-
VLOG(4) << "End Verifying for: ShardTensorOp.";
127+
VLOG(6) << "End Verifying for: ShardTensorOp.";
128128
}
129129

130130
void ShardTensorOp::Build(pir::Builder& builder,

paddle/fluid/pir/dialect/op_generator/op_verify_gen.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
# verify
1616
OP_VERIFY_TEMPLATE = """
1717
void {op_name}::VerifySig() {{
18-
VLOG(4) << "Start Verifying inputs, outputs and attributes for: {op_name}.";
19-
VLOG(4) << "Verifying inputs:";
18+
VLOG(8) << "Start Verifying inputs, outputs and attributes for: {op_name}.";
19+
VLOG(8) << "Verifying inputs:";
2020
{{
2121
auto input_size = num_operands();
2222
PADDLE_ENFORCE_EQ(input_size , {inputs_size}, common::errors::InvalidArgument(
2323
"The size of inputs must be equal to {inputs_size}."));{inputs_type_check}
2424
}}
25-
VLOG(4) << "Verifying attributes:";
25+
VLOG(8) << "Verifying attributes:";
2626
{{{attributes_check}
2727
}}
28-
VLOG(4) << "Verifying outputs:";
28+
VLOG(8) << "Verifying outputs:";
2929
{{
3030
auto output_size = num_results();
3131
PADDLE_ENFORCE_EQ(output_size, {outputs_size}, common::errors::InvalidArgument(
3232
"The size of outputs must be equal to {outputs_size}."));{outputs_type_check}
3333
}}
34-
VLOG(4) << "End Verifying for: {op_name}.";
34+
VLOG(8) << "End Verifying for: {op_name}.";
3535
}}
3636
"""
3737

paddle/fluid/pir/dialect/operator/ir/control_flow_op.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void IfOp::Print(pir::IrPrinter &printer) {
214214
}
215215

216216
void IfOp::VerifySig() {
217-
VLOG(4) << "Start Verifying inputs, outputs and attributes for: IfOp.";
217+
VLOG(6) << "Start Verifying inputs, outputs and attributes for: IfOp.";
218218
auto input_size = num_operands();
219219
PADDLE_ENFORCE_EQ(
220220
input_size,
@@ -243,8 +243,8 @@ void IfOp::VerifySig() {
243243
}
244244

245245
void IfOp::VerifyRegion() {
246-
VLOG(4) << "Start Verifying sub regions for: IfOp.";
247-
VLOG(4) << "Start Verifying true branch.";
246+
VLOG(6) << "Start Verifying sub regions for: IfOp.";
247+
VLOG(6) << "Start Verifying true branch.";
248248
PADDLE_ENFORCE_EQ(
249249
(*this)->region(0).size(),
250250
1u,
@@ -267,7 +267,7 @@ void IfOp::VerifyRegion() {
267267
common::errors::PreconditionNotMet(
268268
"The size of last of true block op's input must be "
269269
"equal to IfOp's outputs num."));
270-
VLOG(4) << "Start Verifying false branch.";
270+
VLOG(6) << "Start Verifying false branch.";
271271
PADDLE_ENFORCE_EQ((*this)->region(1).size(),
272272
1u,
273273
common::errors::PreconditionNotMet(
@@ -545,7 +545,7 @@ void WhileOp::Print(pir::IrPrinter &printer) {
545545
}
546546

547547
void WhileOp::VerifySig() {
548-
VLOG(4) << "Start Verifying inputs, outputs and attributes for: WhileOp.";
548+
VLOG(6) << "Start Verifying inputs, outputs and attributes for: WhileOp.";
549549
auto input_size = num_operands();
550550
PADDLE_ENFORCE_GE(
551551
input_size,
@@ -1153,8 +1153,8 @@ OpInfoTuple AssertOp::GetOpInfo() {
11531153
}
11541154

11551155
void AssertOp::VerifySig() {
1156-
VLOG(4) << "Start Verifying inputs, outputs and attributes for: AssertOp.";
1157-
VLOG(4) << "Verifying inputs:";
1156+
VLOG(6) << "Start Verifying inputs, outputs and attributes for: AssertOp.";
1157+
VLOG(6) << "Verifying inputs:";
11581158
{
11591159
auto input_size = num_operands();
11601160
PADDLE_ENFORCE_EQ(
@@ -1199,7 +1199,7 @@ void AssertOp::VerifySig() {
11991199
"Type validation failed for the 1th input."));
12001200
}
12011201
}
1202-
VLOG(4) << "Verifying attributes:";
1202+
VLOG(6) << "Verifying attributes:";
12031203
{
12041204
auto &attributes = this->attributes();
12051205
PADDLE_ENFORCE_GT(
@@ -1212,7 +1212,7 @@ void AssertOp::VerifySig() {
12121212
common::errors::InvalidArgument(
12131213
"Type of attribute: summarize is not pir::Int64Attribute."));
12141214
}
1215-
VLOG(4) << "Verifying outputs:";
1215+
VLOG(6) << "Verifying outputs:";
12161216
{
12171217
auto output_size = num_results();
12181218
PADDLE_ENFORCE_EQ(
@@ -1222,7 +1222,7 @@ void AssertOp::VerifySig() {
12221222
"The size %d of outputs must be equal to 0.", output_size));
12231223
// Outputs num is 0, not need to check outputs type.
12241224
}
1225-
VLOG(4) << "End Verifying for: AssertOp.";
1225+
VLOG(6) << "End Verifying for: AssertOp.";
12261226
}
12271227

12281228
void SelectInputOp::VerifySig() {

0 commit comments

Comments
 (0)