已合并
refactor: 算子 tiling 报错日志整改 #6677
陈思创建于 6月27日
refactor: 算子 tiling 报错日志整改 #6677
已合并
陈思创建于 6月27日
共 8 个文件变更+95-51
@@ -145,9 +145,16 @@ ge::graphStatus UpdateStrideAndDilationByFormat(
145 format.c_str(), "NCHW or NHWC");145 format.c_str(), "NCHW or NHWC");
146 return ge::GRAPH_FAILED;146 return ge::GRAPH_FAILED;
147 }147 }
148- OP_CHECK_IF(148+ OP_CHECK_IF(deformableOffsetAttrInfo.strideH == 0 || deformableOffsetAttrInfo.strideW == 0,
149- deformableOffsetAttrInfo.strideH == 0 || deformableOffsetAttrInfo.strideW == 0,149+ OP_LOGE_FOR_INVALID_VALUES_WITH_REASON(
150- OP_LOGE(context->GetNodeName(), "StrideH not equal to 0"), return ge::GRAPH_FAILED);150+ context->GetNodeName(), "strides",
151+ ("{" + std::to_string(stridesData[0]) + "," + std::to_string(stridesData[1]) + "," +
152+ std::to_string(stridesData[2]) + "," + std::to_string(stridesData[3]) + "}")
153+ .c_str(),
154+ "The H and W dimensions of strides must not be 0.(The third dimension is H dimension and the "
155+ "fourth dimension is W dimension in NCHW format; the second dimension is H dimension and the third "
156+ "dimension is W dimension in NHWC format)"),
157+ return ge::GRAPH_FAILED);
151 return ge::GRAPH_SUCCESS;158 return ge::GRAPH_SUCCESS;
152}159}
153 160 
@@ -327,7 +327,10 @@ ge::graphStatus DeformableOffsetsGradAscendCTilingImpl::GetAttrInfoAndCheck() {
327 OP_CHECK_NULL_WITH_CONTEXT(context_, deformableGroupsPtr);327 OP_CHECK_NULL_WITH_CONTEXT(context_, deformableGroupsPtr);
328 deformableGroupsAttr_ = *deformableGroupsPtr;328 deformableGroupsAttr_ = *deformableGroupsPtr;
329 OP_CHECK_IF(deformableGroupsAttr_ <= 0,329 OP_CHECK_IF(deformableGroupsAttr_ <= 0,
330- OP_LOGE(context_->GetNodeName(), "Deformable groups must be greater than 0"), return ge::GRAPH_FAILED);330+ OP_LOGE_FOR_INVALID_VALUE_WITH_REASON(context_->GetNodeName(), "deformable_groups",
331+ std::to_string(deformableGroupsAttr_).c_str(),
332+ "The value of deformable_groups must be greater than 0"),
333+ return ge::GRAPH_FAILED);
331 strideH_ = stridesData[LIST_INDEX_1];334 strideH_ = stridesData[LIST_INDEX_1];
332 strideW_ = stridesData[LIST_INDEX_2];335 strideW_ = stridesData[LIST_INDEX_2];
333 dilationH_ = dilatesData[LIST_INDEX_1];336 dilationH_ = dilatesData[LIST_INDEX_1];
@@ -368,7 +371,7 @@ ge::graphStatus DeformableOffsetsGradAscendCTilingImpl::UpdateStrideAndDilationB
368 stridesData[LIST_INDEX_0] != 1 || dilatesData[LIST_INDEX_0] != 1,371 stridesData[LIST_INDEX_0] != 1 || dilatesData[LIST_INDEX_0] != 1,
369 OP_LOGE_FOR_INVALID_VALUES_WITH_REASON(context_->GetNodeName(), "strides and dilations",372 OP_LOGE_FOR_INVALID_VALUES_WITH_REASON(context_->GetNodeName(), "strides and dilations",
370 ("stride[0]:" + std::to_string(stridesData[0]) + " and " + "dilation[0]:" + std::to_string(dilatesData[0])).c_str(),373 ("stride[0]:" + std::to_string(stridesData[0]) + " and " + "dilation[0]:" + std::to_string(dilatesData[0])).c_str(),
371- "the N dimension of stride(stride[0]) and dilation(dilation[0]) must be 1"),374+ "The N dimension of stride(stride[0]) and dilation(dilation[0]) must be 1"),
372 return ge::GRAPH_FAILED);375 return ge::GRAPH_FAILED);
373 376 
374 int64_t offsetHeightSame = offsetHeight_ * static_cast<int64_t>(dimKh_);377 int64_t offsetHeightSame = offsetHeight_ * static_cast<int64_t>(dimKh_);
@@ -119,7 +119,9 @@ ge::graphStatus ForeachNonFiniteCheckAndUnscaleTiling::Init()
119 OP_CHECK_NULL_WITH_CONTEXT(tilingContext, shapePtr);119 OP_CHECK_NULL_WITH_CONTEXT(tilingContext, shapePtr);
120 tensorDataCountList[i] = shapePtr->GetStorageShape().GetShapeSize();120 tensorDataCountList[i] = shapePtr->GetStorageShape().GetShapeSize();
121 OP_CHECK_IF(121 OP_CHECK_IF(
122- tensorDataCountList[i] == 0, OP_LOGE(nodeName, "Input shape not support empty tensor."),122+ tensorDataCountList[i] == 0, OP_LOGE_FOR_INVALID_SHAPESIZE_WITH_REASON(nodeName.c_str(),
123+ ("scaled_grads[" + std::to_string(i) + "]").c_str(), "0",
124+ "The shape size of scaled_grads must be greater than 0"),
123 return ge::GRAPH_FAILED);125 return ge::GRAPH_FAILED);
124 // Make a 32-byte alignment for each Tensor126 // Make a 32-byte alignment for each Tensor
125 tensorDataCountAlignedList[i] = CeilDiv(tensorDataCountList[i], elementsPerBlock) * elementsPerBlock;127 tensorDataCountAlignedList[i] = CeilDiv(tensorDataCountList[i], elementsPerBlock) * elementsPerBlock;
@@ -140,7 +140,9 @@ bool GroupNormGradTiling::CheckInputDtype()
140 return false;140 return false;
141 }141 }
142 this->dtypeBytes = GetDataTypeSize(this->dtypeStr);142 this->dtypeBytes = GetDataTypeSize(this->dtypeStr);
143- OP_TILING_CHECK((this->dtypeBytes == 0), OP_LOGE(tilingContext->GetNodeName(), "dtypeBytes is zero"), return false);143+ OP_TILING_CHECK((this->dtypeBytes == 0), OP_LOGE_FOR_INVALID_DTYPE_WITH_REASON(tilingContext->GetNodeName(), "x",
144+ ge::TypeUtils::DataTypeToSerialString(this->dtypeStr).c_str(),
145+ "The dtype size of x must be greater than 0"), return false);
144 // Calculate elePerBlock based on the value of dtypeBytes146 // Calculate elePerBlock based on the value of dtypeBytes
145 this->elePerBlock = GetElePerBlock(this->dtypeBytes);147 this->elePerBlock = GetElePerBlock(this->dtypeBytes);
146 OP_TILING_CHECK(148 OP_TILING_CHECK(
@@ -152,8 +152,11 @@ static ge::graphStatus CheckGammaAndBetaParams(
152 auto gammaDtype = gammaDtypePtr->GetDataType();152 auto gammaDtype = gammaDtypePtr->GetDataType();
153 OP_CHECK_IF(153 OP_CHECK_IF(
154 (CheckMixType(context, xDtype, gammaDtype) == ge::GRAPH_FAILED),154 (CheckMixType(context, xDtype, gammaDtype) == ge::GRAPH_FAILED),
155- OP_LOGE(155+ OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON(
156- context->GetNodeName(), "The dtype combination of gamma, beta and inputs is invalid."),156+ context->GetNodeName(), "x, gamma",
157+ (ge::TypeUtils::DataTypeToSerialString(xDtype) + ", " +
158+ ge::TypeUtils::DataTypeToSerialString(gammaDtype)).c_str(),
159+ "The dtype of gamma must be the same as x, or be float32 when x is float16 or bfloat16"),
157 return ge::GRAPH_FAILED);160 return ge::GRAPH_FAILED);
158 }161 }
159 162 
@@ -172,8 +175,11 @@ static ge::graphStatus CheckGammaAndBetaParams(
172 auto betaDtype = betaDtypePtr->GetDataType();175 auto betaDtype = betaDtypePtr->GetDataType();
173 OP_CHECK_IF(176 OP_CHECK_IF(
174 (CheckMixType(context, xDtype, betaDtype) == ge::GRAPH_FAILED),177 (CheckMixType(context, xDtype, betaDtype) == ge::GRAPH_FAILED),
175- OP_LOGE( 178+ OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON(
176- context->GetNodeType(), "The dtype combination of gamma, beta and inputs is invalid."),179+ context->GetNodeName(), "x, beta",
180+ (ge::TypeUtils::DataTypeToSerialString(xDtype) + ", " +
181+ ge::TypeUtils::DataTypeToSerialString(betaDtype)).c_str(),
182+ "The dtype of beta must be the same as x, or be float32 when x is float16 or bfloat16"),
177 return ge::GRAPH_FAILED);183 return ge::GRAPH_FAILED);
178 }184 }
179 return ge::GRAPH_SUCCESS;185 return ge::GRAPH_SUCCESS;
@@ -142,7 +142,9 @@ static ge::graphStatus CheckInputParams(const gert::TilingContext *context)
142 auto xDtype = context->GetInputDesc(INPUT_IDX_X)->GetDataType();142 auto xDtype = context->GetInputDesc(INPUT_IDX_X)->GetDataType();
143 int64_t xDtypeSize = static_cast<int64_t>(ge::GetSizeByDataType(xDtype));143 int64_t xDtypeSize = static_cast<int64_t>(ge::GetSizeByDataType(xDtype));
144 OP_CHECK_IF((xDtypeSize <= 0),144 OP_CHECK_IF((xDtypeSize <= 0),
145- OP_LOGE(context->GetNodeName(), "xDtypeSize is invalid %ld, please check.", xDtypeSize),145+ OP_LOGE_FOR_INVALID_DTYPE_WITH_REASON(context->GetNodeName(), "x",
146+ ge::TypeUtils::DataTypeToSerialString(xDtype).c_str(),
147+ "The dtype size of x must be greater than 0"),
146 return ge::GRAPH_FAILED);148 return ge::GRAPH_FAILED);
147 auto xShape = inputX->GetStorageShape();149 auto xShape = inputX->GetStorageShape();
148 int64_t channel = xShape.GetDim(DIM_1);150 int64_t channel = xShape.GetDim(DIM_1);
@@ -191,8 +193,11 @@ static ge::graphStatus CheckInputParams(const gert::TilingContext *context)
191 "The datatype size of gamma must be greater than or equal to 0, and the dtype of gamma must be same as beta."),193 "The datatype size of gamma must be greater than or equal to 0, and the dtype of gamma must be same as beta."),
192 return ge::GRAPH_FAILED);194 return ge::GRAPH_FAILED);
193 OP_CHECK_IF((CheckMixType(xDtype, gammaDtype) == ge::GRAPH_FAILED),195 OP_CHECK_IF((CheckMixType(xDtype, gammaDtype) == ge::GRAPH_FAILED),
194- OP_LOGE(context->GetNodeName(), 196+ OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON(context->GetNodeName(), "x, gamma, beta",
195- "The dtype combination of gamma, beta and inputs is invalid."),197+ (ge::TypeUtils::DataTypeToSerialString(xDtype) + ", " +
198+ ge::TypeUtils::DataTypeToSerialString(gammaDtype) + ", " +
199+ ge::TypeUtils::DataTypeToSerialString(betaDtype)).c_str(),
200+ "The dtype of gamma and beta must be the same as x, or be float32 when x is float16 or bfloat16"),
196 return ge::GRAPH_FAILED);201 return ge::GRAPH_FAILED);
197 return ge::GRAPH_SUCCESS;202 return ge::GRAPH_SUCCESS;
198}203}
Mquant/dequant_swiglu_quant/op_host/dequant_swiglu_quant_tiling.cpp+10-6文件内容审核中,请稍后刷新重试
@@ -326,15 +326,16 @@ ge::graphStatus DequantSwigluQuantV35DskTiling::CheckInputWeightScale()
326 if (wScaleDimNum > static_cast<size_t>(1)) {326 if (wScaleDimNum > static_cast<size_t>(1)) {
327 if (hasGroupIndex_) {327 if (hasGroupIndex_) {
328 OP_CHECK_IF(!(wScaleShape.GetDim(0) == groupIndexShape_.GetDim(0) && wScaleShape[wScaleDimNum - 1] == xShape_.GetDim(xDimNum_ - 1)),328 OP_CHECK_IF(!(wScaleShape.GetDim(0) == groupIndexShape_.GetDim(0) && wScaleShape[wScaleDimNum - 1] == xShape_.GetDim(xDimNum_ - 1)),
329- OP_LOGE(context_->GetNodeName(),329+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "weight_scale",
330- "weight_scale shape[0] must be equal to group_index shape[0], and shape[-1] must be equal to x shape[-1] "330+ Ops::Base::ToString(wScaleShape).c_str(),
331- "when group_index exists, please check."),331+ "When group_index exists, the first dim of weight_scale must equal the first dim of group_index, and the last dim of weight_scale must equal the last dim of x"),
332 return ge::GRAPH_FAILED);332 return ge::GRAPH_FAILED);
333 } else {333 } else {
334 OP_CHECK_IF(!(wScaleShape.GetDim(0) == 1 && wScaleShape.GetDim(wScaleDimNum - 1) == xShape_.GetDim(xDimNum_ - 1)) &&334 OP_CHECK_IF(!(wScaleShape.GetDim(0) == 1 && wScaleShape.GetDim(wScaleDimNum - 1) == xShape_.GetDim(xDimNum_ - 1)) &&
335 !(wScaleShape.GetDim(0) == xShape_.GetDim(xDimNum_ - 1) && wScaleShape.GetDim(wScaleDimNum - 1) == 1),335 !(wScaleShape.GetDim(0) == xShape_.GetDim(xDimNum_ - 1) && wScaleShape.GetDim(wScaleDimNum - 1) == 1),
336- OP_LOGE(context_->GetNodeName(), "weight_scale shape must be in {[1, %ld], [%ld, 1]} when weight_scale dimension == 2 and group_index not exists,"336+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "weight_scale",
337- "please check.", xShape_.GetDim(xDimNum_ - 1), xShape_.GetDim(xDimNum_ - 1)),337+ Ops::Base::ToString(wScaleShape).c_str(),
338+ ("When the dimension of weight_scale is " + std::to_string(wScaleDimNum) + " and group_index not exists, weight_scale shape must be in {[1, " + std::to_string(xShape_.GetDim(xDimNum_ - 1)) + "], [" + std::to_string(xShape_.GetDim(xDimNum_ - 1)) + ", 1]}").c_str()),
338 return ge::GRAPH_FAILED);339 return ge::GRAPH_FAILED);
339 }340 }
340 }341 }
@@ -492,38 +493,44 @@ ge::graphStatus DequantSwigluQuantV35DskTiling::CheckInputQuantScale()
492 if (hasGroupIndex_) {493 if (hasGroupIndex_) {
493 if (quantMode_ == 0) {494 if (quantMode_ == 0) {
494 OP_CHECK_IF(qScaleShape.GetDim(0) != (groupIndexShape_.GetDim(0)),495 OP_CHECK_IF(qScaleShape.GetDim(0) != (groupIndexShape_.GetDim(0)),
495- OP_LOGE(context_->GetNodeName(),496+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_scale",
496- "quant_scale shape[0] must be equal to group_index shape[0] when static_quant and group_index exists, please check."),497+ Ops::Base::ToString(qScaleShape).c_str(),
498+ "When quant_mode is static and group_index exists, the first dim of quant_scale must equal the first dim of group_index"),
497 return ge::GRAPH_FAILED);499 return ge::GRAPH_FAILED);
498 if (qScaleDimNum == DIM_TWO) {500 if (qScaleDimNum == DIM_TWO) {
499 OP_CHECK_IF(!((qScaleShape.GetDim(qScaleDimNum - 1) == yShape.GetDim(xDimNum_ - 1)) || (qScaleShape.GetDim(qScaleDimNum - 1) == 1)),501 OP_CHECK_IF(!((qScaleShape.GetDim(qScaleDimNum - 1) == yShape.GetDim(xDimNum_ - 1)) || (qScaleShape.GetDim(qScaleDimNum - 1) == 1)),
500- OP_LOGE(context_->GetNodeName(),502+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_scale",
501- "quant_scale shape[-1] must be equal to or can be broadcast to y shape[-1] when static_quant and group_index exists, please check."),503+ Ops::Base::ToString(qScaleShape).c_str(),
504+ "When quant_mode is static and group_index exists, the last dim of quant_scale must equal the last dim of y or be 1 (broadcastable)"),
502 return ge::GRAPH_FAILED);505 return ge::GRAPH_FAILED);
503 }506 }
504 } else if (quantMode_ == 1) {507 } else if (quantMode_ == 1) {
505 OP_CHECK_IF(qScaleShape.GetDim(0) != groupIndexShape_.GetDim(0) || qScaleShape.GetDim(qScaleDimNum - 1) != yShape.GetDim(xDimNum_ - 1),508 OP_CHECK_IF(qScaleShape.GetDim(0) != groupIndexShape_.GetDim(0) || qScaleShape.GetDim(qScaleDimNum - 1) != yShape.GetDim(xDimNum_ - 1),
506- OP_LOGE(context_->GetNodeName(),509+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_scale",
507- "quant_scale shape must be [ group_index_shape[0], y_shape[-1] ] when dynamic quant and group_index exists, please check."),510+ Ops::Base::ToString(qScaleShape).c_str(),
511+ "When dynamic quant and group_index exists, the shape of quant_scale must be [the first dim of group_index, the last dim of y]"),
508 return ge::GRAPH_FAILED);512 return ge::GRAPH_FAILED);
509 }513 }
510 quantIsOne_ = (qScaleDimNum == DIM_TWO && qScaleShape.GetDim(qScaleDimNum - 1) == yShape.GetDim(xDimNum_ - 1)) ? 0 : 1;514 quantIsOne_ = (qScaleDimNum == DIM_TWO && qScaleShape.GetDim(qScaleDimNum - 1) == yShape.GetDim(xDimNum_ - 1)) ? 0 : 1;
511 } else {515 } else {
512 if (qScaleDimNum == DIM_TWO) {516 if (qScaleDimNum == DIM_TWO) {
513 OP_CHECK_IF(qScaleShape.GetDim(0) != 1,517 OP_CHECK_IF(qScaleShape.GetDim(0) != 1,
514- OP_LOGE(context_->GetNodeName(),518+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_scale",
515- "if dim of quant_scale is 2, shape[0] must be [1] when group_index not exists, please check."),519+ Ops::Base::ToString(qScaleShape).c_str(),
520+ ("When quant_scale dimension is " + std::to_string(qScaleDimNum) + " and group_index not exists, the first dim of quant_scale must be 1").c_str()),
516 return ge::GRAPH_FAILED);521 return ge::GRAPH_FAILED);
517 }522 }
518 if (quantMode_ == 0) {523 if (quantMode_ == 0) {
519 OP_CHECK_IF(qScaleShape.GetDim(0) != 1 && qScaleShape.GetDim(0) != yShape.GetDim(xDimNum_ - 1),524 OP_CHECK_IF(qScaleShape.GetDim(0) != 1 && qScaleShape.GetDim(0) != yShape.GetDim(xDimNum_ - 1),
520- OP_LOGE(context_->GetNodeName(),525+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_scale",
521- "quant_scale shape[0] must be or can be broadcast to y shape[-1] when static_quant and group_index not exists, please check."),526+ Ops::Base::ToString(qScaleShape).c_str(),
527+ "When quant_mode is static and group_index not exists, the first dim of quant_scale must equal the last dim of y or be 1 (broadcastable)"),
522 return ge::GRAPH_FAILED);528 return ge::GRAPH_FAILED);
523 } else if (quantMode_ == 1) {529 } else if (quantMode_ == 1) {
524 OP_CHECK_IF(qScaleShape.GetDim(qScaleDimNum - 1) != yShape.GetDim(xDimNum_ - 1),530 OP_CHECK_IF(qScaleShape.GetDim(qScaleDimNum - 1) != yShape.GetDim(xDimNum_ - 1),
525- OP_LOGE(context_->GetNodeName(),531+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_scale",
526- "quant_scale shape[-1] must be equal to y shape[-1] when dynamic_quant and group_index not exists, please check."),532+ Ops::Base::ToString(qScaleShape).c_str(),
533+ "When dynamic_quant and group_index not exists, the last dim of quant_scale must equal the last dim of y"),
527 return ge::GRAPH_FAILED);534 return ge::GRAPH_FAILED);
528 }535 }
529 quantIsOne_ = qScaleShape.GetDim(qScaleDimNum - 1) == yShape.GetDim(xDimNum_ - 1) ? 0 : 1;536 quantIsOne_ = qScaleShape.GetDim(qScaleDimNum - 1) == yShape.GetDim(xDimNum_ - 1) ? 0 : 1;
@@ -532,7 +539,8 @@ ge::graphStatus DequantSwigluQuantV35DskTiling::CheckInputQuantScale()
532 }539 }
533 if (quantMode_ == 0) {540 if (quantMode_ == 0) {
534 OP_CHECK_IF(!hasQuantScale_,541 OP_CHECK_IF(!hasQuantScale_,
535- OP_LOGE(context_->GetNodeName(), "quant_scale must exist when static_quant, please check."),542+ OP_LOGE_FOR_INVALID_VALUE_WITH_REASON(context_->GetNodeName(), "quant_scale", "None",
543+ "Quant_scale cann not be none when quant_mode is static"),
536 return ge::GRAPH_FAILED);544 return ge::GRAPH_FAILED);
537 }545 }
538 return ge::GRAPH_SUCCESS;546 return ge::GRAPH_SUCCESS;
@@ -573,25 +581,29 @@ ge::graphStatus DequantSwigluQuantV35DskTiling::CheckInputQuantOffset()
573 auto& yShape = EnsureNotScalar(yStorageShape->GetStorageShape());581 auto& yShape = EnsureNotScalar(yStorageShape->GetStorageShape());
574 if (hasGroupIndex_) {582 if (hasGroupIndex_) {
575 OP_CHECK_IF(qOffsetShape.GetDim(0) != (groupIndexShape_.GetDim(0)),583 OP_CHECK_IF(qOffsetShape.GetDim(0) != (groupIndexShape_.GetDim(0)),
576- OP_LOGE(context_->GetNodeName(),584+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_offset",
577- "quant_offset shape[0] must be equal to group_index shape[0] when group_index exists, please check."),585+ Ops::Base::ToString(qOffsetShape).c_str(),
586+ "When group_index exists, the first dim of quant_offset must equal the first dim of group_index"),
578 return ge::GRAPH_FAILED);587 return ge::GRAPH_FAILED);
579 if (qOffsetDimNum == DIM_TWO) {588 if (qOffsetDimNum == DIM_TWO) {
580 OP_CHECK_IF(qOffsetShape.GetDim(qOffsetDimNum - 1) != 1 && qOffsetShape.GetDim(qOffsetDimNum - 1) != yShape.GetDim(xDimNum_ - 1),589 OP_CHECK_IF(qOffsetShape.GetDim(qOffsetDimNum - 1) != 1 && qOffsetShape.GetDim(qOffsetDimNum - 1) != yShape.GetDim(xDimNum_ - 1),
581- OP_LOGE(context_->GetNodeName(),590+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_offset",
582- "quant_offset shape[-1] must be equal to or can be broadcast to y shape[-1] when group_index exists, please check."),591+ Ops::Base::ToString(qOffsetShape).c_str(),
592+ "When group_index exists, the last dim of quant_offset must equal the last dim of y or be 1 (broadcastable)"),
583 return ge::GRAPH_FAILED);593 return ge::GRAPH_FAILED);
584 }594 }
585 } else {595 } else {
586 if (qOffsetDimNum == DIM_TWO) {596 if (qOffsetDimNum == DIM_TWO) {
587 OP_CHECK_IF(qOffsetShape.GetDim(0) != 1,597 OP_CHECK_IF(qOffsetShape.GetDim(0) != 1,
588- OP_LOGE(context_->GetNodeName(),598+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_offset",
589- "if dim of quant_offset is 2, shape[0] must be [1] when group_index not exists, please check."),599+ Ops::Base::ToString(qOffsetShape).c_str(),
600+ ("When quant_offset dimension is " + std::to_string(qOffsetDimNum) + " and group_index not exists, the first dim of quant_offset must be 1").c_str()),
590 return ge::GRAPH_FAILED);601 return ge::GRAPH_FAILED);
591 }602 }
592 OP_CHECK_IF(qOffsetShape.GetDim(0) != 1 && qOffsetShape.GetDim(0) != yShape.GetDim(xDimNum_ - 1),603 OP_CHECK_IF(qOffsetShape.GetDim(0) != 1 && qOffsetShape.GetDim(0) != yShape.GetDim(xDimNum_ - 1),
593- OP_LOGE(context_->GetNodeName(),604+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "quant_offset",
594- "quant_offset shape[0] must be or can be broadcast to y shape[-1] when static_quant and group_index not exists, please check."),605+ Ops::Base::ToString(qOffsetShape).c_str(),
606+ "When quant_mode is static and group_index not exists, the first dim of quant_offset must equal the last dim of y or be 1 (broadcastable)"),
595 return ge::GRAPH_FAILED);607 return ge::GRAPH_FAILED);
596 }608 }
597 hasQuantOffset_ = true;609 hasQuantOffset_ = true;
@@ -611,7 +623,9 @@ ge::graphStatus DequantSwigluQuantV35DskTiling::CheckForStaticQuant() // 静态
611 OP_CHECK_NULL_WITH_CONTEXT(context_, qOffsetStorageShape);623 OP_CHECK_NULL_WITH_CONTEXT(context_, qOffsetStorageShape);
612 int64_t qOffsetSize = qOffsetStorageShape->GetStorageShape().GetShapeSize();624 int64_t qOffsetSize = qOffsetStorageShape->GetStorageShape().GetShapeSize();
613 OP_CHECK_IF(qScaleSize != qOffsetSize,625 OP_CHECK_IF(qScaleSize != qOffsetSize,
614- OP_LOGE(context_->GetNodeName(), "quant_scale size should be equal to quant_offset size, please check."),626+ OP_LOGE_FOR_INVALID_SHAPESIZES_WITH_REASON(context_->GetNodeName(), "quant_scale, quant_offset",
627+ (std::to_string(qScaleSize) + ", " + std::to_string(qOffsetSize)).c_str(),
628+ "The shape size of quant_scale must be equal to the shape size of quant_offset"),
615 return ge::GRAPH_FAILED);629 return ge::GRAPH_FAILED);
616 return ge::GRAPH_SUCCESS;630 return ge::GRAPH_SUCCESS;
617}631}
@@ -636,14 +650,15 @@ ge::graphStatus DequantSwigluQuantV35DskTiling::CheckOutputScale()
636 const size_t yDimNum = yShape.GetDimNum();650 const size_t yDimNum = yShape.GetDimNum();
637 651 
638 OP_CHECK_IF(scaleDimNum != (yDimNum - 1),652 OP_CHECK_IF(scaleDimNum != (yDimNum - 1),
639- OP_LOGE(context_->GetNodeName(),653+ OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON(context_->GetNodeName(), "scale", std::to_string(scaleDimNum).c_str(),
640- "scale dimension should be only 1 less than y dimension, please check."),654+ "The dimension of scale must be exactly 1 less than the dimension of y"),
641 return ge::GRAPH_FAILED);655 return ge::GRAPH_FAILED);
642 656 
643 for (size_t i = 0; i < scaleDimNum; i++) {657 for (size_t i = 0; i < scaleDimNum; i++) {
644 OP_CHECK_IF(scaleShape[i] != yShape[i],658 OP_CHECK_IF(scaleShape[i] != yShape[i],
645- OP_LOGE(context_->GetNodeName(),659+ OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(context_->GetNodeName(), "scale",
646- "scale shape[%zu] must be equal to y shape[%zu], please check.", i, i),660+ Ops::Base::ToString(scaleShape).c_str(),
661+ "The shape of scale must the same as that of y"),
647 return ge::GRAPH_FAILED);662 return ge::GRAPH_FAILED);
648 }663 }
649 return ge::GRAPH_SUCCESS;664 return ge::GRAPH_SUCCESS;