Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -1754,9 +1754,9 @@ bool FusedAttentionOpInferSymbolicShape(
PADDLE_ENFORCE_EQ(qkv_weight_shape.size(),
2,
common::errors::InvalidArgument(
"The dimensions of qkv_weight must be 2 if enable"
"transpose_qkv_wb: (dim_embed, 3 * dim_embed),"
"but received dimensions of"
"The dimensions of qkv_weight must be 2 if enable "
"transpose_qkv_wb: (dim_embed, 3 * dim_embed), "
"but received dimensions of "
"Input is [%d]",
qkv_weight_shape.size()));
PADDLE_ENFORCE_GT(num_heads_,
Expand All @@ -1779,7 +1779,7 @@ bool FusedAttentionOpInferSymbolicShape(
PADDLE_ENFORCE_EQ(qkv_weight_shape.size(),
4,
common::errors::InvalidArgument(
"The dimensions of qkv_weight must be 4 if not"
"The dimensions of qkv_weight must be 4 if not "
"enable transpose_qkv_wb: (3, num_head, dim_head, "
"dim_embed), but received [%d]",
qkv_weight_shape.size()));
Expand Down Expand Up @@ -2227,16 +2227,16 @@ bool FusedMultiTransformerOpInferSymbolicShape(
x_shape.size(),
3,
common::errors::InvalidArgument("The dimensions of x must be 3"
"(batch_size, seq_len, dim_embed),"
"but received dimensions of"
"(batch_size, seq_len, dim_embed), "
"but received dimensions of "
"Input is [%d]",
x_shape.size()));
PADDLE_ENFORCE_EQ(
y_shape.size(),
4,
common::errors::InvalidArgument("The dimensions of qkv_weight must be 4"
"(3, num_head, dim_head, dim_embed),"
"but received dimensions of"
"(3, num_head, dim_head, dim_embed), "
"but received dimensions of "
"Input is [%d]",
y_shape.size()));

Expand Down Expand Up @@ -3086,19 +3086,19 @@ bool MemoryEfficientAttentionOpInferSymbolicShape(
PADDLE_ENFORCE_EQ(
q_shape.size(),
4,
common::errors::InvalidArgument("Query should be a 4-D tensor"
common::errors::InvalidArgument("Query should be a 4-D tensor. "
"But received Query dimension(%d)",
q_shape.size()));
PADDLE_ENFORCE_EQ(
k_shape.size(),
4,
common::errors::InvalidArgument("Key should be a 4-D tensor"
common::errors::InvalidArgument("Key should be a 4-D tensor. "
"But received Key dimension(%d)",
k_shape.size()));
PADDLE_ENFORCE_EQ(
v_shape.size(),
4,
common::errors::InvalidArgument("Value should be a 4-D tensor"
common::errors::InvalidArgument("Value should be a 4-D tensor. "
"But received Value dimension(%d)",
v_shape.size()));

Expand Down Expand Up @@ -4808,12 +4808,12 @@ bool YoloLossOpInferSymbolicShape(
if (op->operand_source(3) != nullptr) {
const auto &score_shape =
infer_context->GetShapeOrDataForValue(op->operand_source(3)).shape();
PADDLE_ENFORCE_EQ(
score_shape.size(),
2,
common::errors::InvalidArgument("Input(GTScore) should be a 2-D tensor"
"But received GTScore dimension(%s)",
box_shape.size()));
PADDLE_ENFORCE_EQ(score_shape.size(),
2,
common::errors::InvalidArgument(
"Input(GTScore) should be a 2-D tensor. "
"But received GTScore dimension(%s)",
box_shape.size()));
infer_context->AddEqualCstr(score_shape[0], box_shape[0]);
infer_context->AddEqualCstr(score_shape[1], box_shape[1]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ bool FlattenOpInferSymbolicShape(
PADDLE_ENFORCE_GE(
stop_axis,
start_axis,
common::errors::InvalidArgument("The stop_axis should be greater"
common::errors::InvalidArgument("The stop_axis should be greater "
"than or equal to start_axis."));
}

Expand Down Expand Up @@ -2035,7 +2035,7 @@ bool MaxPool2dWithIndexOpInferSymbolicShape(
PADDLE_ENFORCE_EQ(
x_shape.size(),
4,
common::errors::InvalidArgument("Pooling input should be 4-D Tensor"
common::errors::InvalidArgument("Pooling input should be 4-D Tensor, "
"but received %dD-Tensor",
x_shape.size()));

Expand Down Expand Up @@ -2069,7 +2069,7 @@ bool MaxPool3dWithIndexOpInferSymbolicShape(
PADDLE_ENFORCE_EQ(
x_shape.size(),
5,
common::errors::InvalidArgument("Pooling input should be 5-D Tensor"
common::errors::InvalidArgument("Pooling input should be 5-D Tensor, "
"but received %dD-Tensor",
x_shape.size()));

Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pir/dialect/operator/ir/manual_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ void FusedGemmEpilogueGradOp::Build(pir::Builder &builder,

PADDLE_ENFORCE(
attributes.find("activation_grad") != attributes.end(),
common::errors::NotFound("'activation_grad' Attribute is expected for"
common::errors::NotFound("'activation_grad' Attribute is expected for "
"FusedGemmEpilogueGradOp"));
std::string activation_grad =
attributes.at("activation_grad").dyn_cast<pir::StrAttribute>().AsString();
Expand Down Expand Up @@ -1071,7 +1071,7 @@ std::vector<pir::Type> FusedGemmEpilogueGradOp::InferMeta(

PADDLE_ENFORCE(
attributes.find("activation_grad") != attributes.end(),
common::errors::NotFound("'activation_grad' Attribute is expected for"
common::errors::NotFound("'activation_grad' Attribute is expected for "
"FusedGemmEpilogueGradOp"));
std::string activation_grad =
attributes.at("activation_grad").dyn_cast<pir::StrAttribute>().AsString();
Expand Down
12 changes: 6 additions & 6 deletions paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2851,9 +2851,9 @@ std::vector<pir::Value> BuildInputs(
PADDLE_THROW(common::errors::Unimplemented(
"builtin.combine Input type only support "
"VectorType<DenseTensorType> and "
"VectorType<SelectedRowsType> and"
"VectorType<DenseTensorArrayType> and"
"VectorType<SparseCooTensorType> and"
"VectorType<SelectedRowsType> and "
"VectorType<DenseTensorArrayType> and "
"VectorType<SparseCooTensorType> and "
"VectorType<SparseCsrTensorType>"));
}

Expand Down Expand Up @@ -2912,9 +2912,9 @@ std::vector<pir::Value> BuildInputs(
PADDLE_THROW(common::errors::Unimplemented(
"builtin.combine Input type only support "
"VectorType<DenseTensorType> and "
"VectorType<SelectedRowsType> and"
"VectorType<DenseTensorArrayType> and"
"VectorType<SparseCooTensorType> and"
"VectorType<SelectedRowsType> and "
"VectorType<DenseTensorArrayType> and "
"VectorType<SparseCooTensorType> and "
"VectorType<SparseCsrTensorType>"));
}
in_i = AddPlaceTransferOp(
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pir/transforms/tensorrt/trt_op_marker_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ class BilinearInterpV2Pattern
if (scale.size() <= 1) {
if (!op->HasAttribute("out_h") || !op->HasAttribute("out_w")) {
VLOG(3) << "BilinearInterpV2 doesn't have scale_tensor and the scale "
"size <=1 and without"
"size <=1 and without "
"out_h / out_w, it will return false";
return false;
}
Expand Down Expand Up @@ -2895,7 +2895,7 @@ class LinearInterpOpPattern
if (!op->HasAttribute("out_w")) {
VLOG(3)
<< "pd_op.linear_interp doesn't have scale_tensor and the scale "
"size <=1 and without"
"size <=1 and without "
"out_w, it will return false";
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions paddle/phi/infermeta/backward.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1157,13 +1157,13 @@ void MemoryEfficientAttentionGradInferMeta(const MetaTensor& query,
PADDLE_ENFORCE_EQ(
output_grad.dims().size(),
4,
common::errors::InvalidArgument("Key should be a 4-D tensor"
common::errors::InvalidArgument("Key should be a 4-D tensor. "
"But received Key dimension(%s)",
output_grad.dims().size()));
PADDLE_ENFORCE_EQ(
output.dims().size(),
4,
common::errors::InvalidArgument("Key should be a 4-D tensor"
common::errors::InvalidArgument("Key should be a 4-D tensor. "
"But received Key dimension(%s)",
output_grad.dims().size()));

Expand Down Expand Up @@ -1254,13 +1254,13 @@ void MoeCombineGradInferMeta(const MetaTensor& x,
PADDLE_ENFORCE_EQ(
x_dim.size(),
2,
errors::InvalidArgument("The input X should have 2 dimensions"
errors::InvalidArgument("The input X should have 2 dimensions. "
"But received X's dimension = %d",
x_dim.size()));
PADDLE_ENFORCE_EQ(
(scatter_index.dtype() == phi::DataType::INT32),
true,
errors::InvalidArgument("The input scatter_index type should be int32"
errors::InvalidArgument("The input scatter_index type should be int32. "
"But received scatter_index type = %s",
scatter_index.dtype()));
grad_x->set_dims(common::make_ddim({x_dim[0], x_dim[1]}));
Expand Down
29 changes: 14 additions & 15 deletions paddle/phi/infermeta/binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,7 @@ void CrossEntropyInferMeta(const MetaTensor& x,
"shall have the same dimensions. But received: the dimensions of "
"Input(X) is [%d],"
"the shape of Input(X) is [%s], the dimensions of Input(Label) "
"is "
"[%d], the shape of"
"is [%d], the shape of "
"Input(Label) is [%s]",
rank,
x_dims,
Expand All @@ -1109,11 +1108,11 @@ void CrossEntropyInferMeta(const MetaTensor& x,
label_dims[rank - 1],
common::errors::InvalidArgument(
"If Attr(soft_label) == true, the last dimension of "
"Input(X) and Input(Label) should be equal. But received: the"
"Input(X) and Input(Label) should be equal. But received: the "
"last dimension of Input(X) is [%d], the shape of Input(X) is "
"[%s],"
"[%s], "
"the last dimension of Input(Label) is [%d], the shape of "
"Input(Label)"
"Input(Label) "
"is [%s], the last dimension is [%d].",
x_dims[rank - 1],
x_dims,
Expand Down Expand Up @@ -2707,9 +2706,9 @@ void LogLossInferMeta(const MetaTensor& input,
pred_dims,
label_dims,
common::errors::InvalidArgument(
"The dimensions of Input(Predicted) must be equal to the"
"The dimensions of Input(Predicted) must be equal to the "
"dimensions of Input(Labels), but received dimensions of "
"Input(Predicted)"
"Input(Predicted) "
"is [%s], received dimensions of Input(Labels) is [%s].",
pred_dims,
label_dims));
Expand Down Expand Up @@ -3332,7 +3331,7 @@ void MvInferMeta(const MetaTensor& x, const MetaTensor& vec, MetaTensor* out) {
dim_vec[0],
common::errors::InvalidArgument(
"X's second dimension is expected to be equal to "
"Vec's first dimension"
"Vec's first dimension, "
"but received X'shape = [%s], Vec's shape = [%s]",
dim_x,
dim_vec));
Expand Down Expand Up @@ -4535,9 +4534,9 @@ void UnpoolInferMeta(const MetaTensor& x,
PADDLE_ENFORCE_EQ(in_x_dims,
in_y_dims,
common::errors::InvalidArgument(
"The dimensions of Input(X) must equal to be"
"the dimensions of Input(Indices), but received"
"dimensions of Input(X) is [%d], received dimensions"
"The dimensions of Input(X) must equal to be "
"the dimensions of Input(Indices), but received "
"dimensions of Input(X) is [%d], received dimensions "
"of Input(Indices) is [%d]",
in_x_dims,
in_y_dims));
Expand Down Expand Up @@ -4581,9 +4580,9 @@ void Unpool3dInferMeta(const MetaTensor& x,
PADDLE_ENFORCE_EQ(in_x_dims,
in_y_dims,
common::errors::InvalidArgument(
"The dimensions of Input(X) must equal to be"
"the dimensions of Input(Indices), but received"
"dimensions of Input(X) is [%d], received dimensions"
"The dimensions of Input(X) must equal to be "
"the dimensions of Input(Indices), but received "
"dimensions of Input(X) is [%d], received dimensions "
"of Input(Indices) is [%d]",
in_x_dims,
in_y_dims));
Expand Down Expand Up @@ -4656,7 +4655,7 @@ void WeightDequantizeInferMeta(const MetaTensor& x,
(x.dims()[1] + (group_size - 1)) / group_size,
errors::InvalidArgument("The input(weight_scale) dim[0] must be equal "
"to (Input(weight).dim[1] + (group_size -1))"
" / group_size"
" / group_size. "
"But receive %d and %d",
dim_scale[0],
(x.dims()[1] + (group_size - 1)) / group_size));
Expand Down
Loading