已合并
增补 9D+ rank 拦截(InferShape + TilingFunc 双层) #8614
Nerddddddddddd创建于 8月12日
增补 9D+ rank 拦截(InferShape + TilingFunc 双层) #8614
已合并
Nerddddddddddd创建于 8月12日
共 2 个文件变更+11-0
@@ -79,6 +79,12 @@ static ge::graphStatus InferShape4ActULQClampMaxGrad(gert::InferShapeContext* co
79 return ge::GRAPH_SUCCESS;79 return ge::GRAPH_SUCCESS;
80 }80 }
81 81 
82+ // 输入 rank 上限 8(不支持 9 维及以上 Tensor)
83+ OP_CHECK_IF(yGradShape->GetDimNum() > 8,
84+ OP_LOGE(context, "ActULQClampMaxGrad: input rank %zu exceeds 8 (9D+ tensor not supported)",
85+ yGradShape->GetDimNum()),
86+ return ge::GRAPH_FAILED);
87+ 
82 // 校验三输入 shape 完全相同(broadcast.kind: none)88 // 校验三输入 shape 完全相同(broadcast.kind: none)
83 OP_CHECK_IF(!ShapeEqual(*yGradShape, *maskShape) || !ShapeEqual(*yGradShape, *xLossShape),89 OP_CHECK_IF(!ShapeEqual(*yGradShape, *maskShape) || !ShapeEqual(*yGradShape, *xLossShape),
84 OP_LOGE(context, "ActULQClampMaxGrad: three inputs must have identical shape (no broadcast)"),90 OP_LOGE(context, "ActULQClampMaxGrad: three inputs must have identical shape (no broadcast)"),
@@ -172,6 +172,11 @@ static ge::graphStatus GetShapeAndDtype(gert::TilingContext* context, Ctx& ctx)
172 // 三输入 shape 必须完全相同(broadcast.kind: none)172 // 三输入 shape 必须完全相同(broadcast.kind: none)
173 OP_CHECK_IF(yS.GetDimNum() != mS.GetDimNum() || yS.GetDimNum() != xS.GetDimNum(),173 OP_CHECK_IF(yS.GetDimNum() != mS.GetDimNum() || yS.GetDimNum() != xS.GetDimNum(),
174 OP_LOGE(context, "ActULQClampMaxGrad: three inputs must have same rank"), return ge::GRAPH_FAILED);174 OP_LOGE(context, "ActULQClampMaxGrad: three inputs must have same rank"), return ge::GRAPH_FAILED);
175+ // 输入 rank 上限 8(不支持 9 维及以上 Tensor)
176+ OP_CHECK_IF(
177+ yS.GetDimNum() > 8,
178+ OP_LOGE(context, "ActULQClampMaxGrad: input rank %zu exceeds 8 (9D+ tensor not supported)", yS.GetDimNum()),
179+ return ge::GRAPH_FAILED);
175 for (size_t i = 0; i < yS.GetDimNum(); ++i) {180 for (size_t i = 0; i < yS.GetDimNum(); ++i) {
176 OP_CHECK_IF(yS.GetDim(i) != mS.GetDim(i) || yS.GetDim(i) != xS.GetDim(i),181 OP_CHECK_IF(yS.GetDim(i) != mS.GetDim(i) || yS.GetDim(i) != xS.GetDim(i),
177 OP_LOGE(context, "ActULQClampMaxGrad: three inputs shape mismatch at dim %zu", i),182 OP_LOGE(context, "ActULQClampMaxGrad: three inputs shape mismatch at dim %zu", i),