Describe the expected behavior / 预期结果 (Mandatory / 必填)
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem. axis=-1 在 1 维输入下语义等价首轴 0,应在 tiling 阶段被正确识别并拦截报错(如"axis does not support 0"),不应进入下游计算。负数 axis 应在 axis == 0 校验之前完成归一化,使归一化后等于 0 的情况被首轴校验捕获;同时过于负的 axis(归一化后仍 < 0 或 >= inputDims)也应一并拦截。
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Scatter 算子 tiling 阶段对
axis属性的校验存在缺陷。GetShapeAttrsInfo中仅检查axis == 0(首轴不支持),但负数 axis 会绕过该校验。以 1 维输入为例,传入
axis=-1(语义上等价于首轴 0):-1 != 0,通过axis == 0校验;MergeDims中执行负数归一化tmpAbsAxis = oldDims + axis = 1 + (-1) = 0;MergeDims仅做范围校验tmpAbsAxis < 0 || tmpAbsAxis >= oldDims,不复查== 0;涉及文件:
index/scatter/op_host/arch35/scatter_tiling_arch35.cpp关键代码(当前):
// GetShapeAttrsInfo const int64_t* axisPtr = attrs->GetAttrPointer<int64_t>(AXIS_INDEX); axis = (axisPtr == nullptr) ? 0 : *axisPtr; if (axis == 0) { // 负数 axis 在此处绕过 ... } // MergeDims int32_t tmpAbsAxis = axis < 0 ? oldDims + axis : axis; // 此处归一化为 0 if (tmpAbsAxis < 0 || tmpAbsAxis >= oldDims) { ... } // 不检查 == 0Environment / 环境信息 (Mandatory / 必填)
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
axis属性传入负数(如axis=-1,表示沿首轴操作);axis=-1在GetShapeAttrsInfo中未被拦截,进入MergeDims归一化为 0;Describe the expected behavior / 预期结果 (Mandatory / 必填)
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
axis=-1在 1 维输入下语义等价首轴 0,应在 tiling 阶段被正确识别并拦截报错(如"axis does not support 0"),不应进入下游计算。负数 axis 应在axis == 0校验之前完成归一化,使归一化后等于 0 的情况被首轴校验捕获;同时过于负的 axis(归一化后仍 < 0 或 >= inputDims)也应一并拦截。Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
NA
Special notes for this issue/备注 (Optional / 选填)
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.