Closed
[Bug-Report|缺陷反馈]:SwigluGroupQuant等算子存在语言规范问题 #6198
高逸凡Add on  Sep 24Closed at  Sep 24
高逸凡
高逸凡Collaborators
Sep 24 Create

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

规范 缺陷描述 文件 代码片段 代码行
G.CNS.02-CPP 不要使用难以理解的字面常量 Do not use magic numbers.The number is 2 ops/ops-nn/activation/swiglu_group_quant/op_host/arch35/swiglu_group_quant_tiling.cpp mxExtendTilingData_.set_weightType(weightType_ == ge::DT_FLOAT16 ? 0 : (weightType_ == ge::DT_BF16 ? 1 : 2)); 837
类型的参数,如果不需要修改其引用的对象,应使用const修饰 pointer parameter context can be pointer to const ops/ops-nn/hash/embedding_hash_table_evict/op_host/embedding_hash_table_evict_infershape.cpp ge::graphStatus InferDataTypeForEmbeddingHashTableEvict(gert::InferDataTypeContext* context) 29
G.CNS.03-CPP 对于不会修改成员变量的成员函数应使用const修饰 member function 'optiling::SwigluGroupQuantTiling::SetBaseTilingData' could be made const ops/ops-nn/activation/swiglu_group_quant/op_host/arch35/swiglu_group_quant_tiling.cpp void SwigluGroupQuantTiling::SetBaseTilingData(TilingDataType& tilingData) 799
G.EXP.15-CPP 避免使用reinterpret_cast do not use reinterpret_cast ops/ops-nn/hash/embedding_hash_table_evict/op_host/arch35/embedding_hash_table_evict_tiling_arch35.cpp const auto* compileInfo = reinterpret_cast(context->GetCompileInfo()); 51
G.EXP.27-CPP 使用恰当的基本类型作为操作符的操作数 The Left operand type of operator '!=' is improperly 'float' ops/ops-nn/activation/swiglu_group_quant/op_host/arch35/swiglu_group_quant_tiling.cpp OP_CHECK_IF(alpha_ != DEFAULT_ALPHA || bias_ != DEFAULT_BIAS, 240
G.EXP.27-CPP 使用恰当的基本类型作为操作符的操作数 The Right operand type of operator '!=' is improperly 'const float' ops/ops-nn/activation/swiglu_group_quant/op_host/arch35/swiglu_group_quant_tiling.cpp OP_CHECK_IF(alpha_ != DEFAULT_ALPHA || bias_ != DEFAULT_BIAS, 240
G.CNS.04-CPP 对于指针和引用类型的参数,如果不需要修改其引用的对象,应使用const修饰 pointer parameter context can be pointer to const ops/ops-nn/hash/embedding_hash_table_evict/op_host/embedding_hash_table_evict_infershape.cpp ge::graphStatus InferDataTypeForEmbeddingHashTableEvict(gert::InferDataTypeContext* context) 29

圈复杂度过大

文件路径 行号 描述
ops/ops-nn/activation/swiglu_group_quant/op_kernel/arch35/swiglu_mxfp4_quant_perf.h 82 the cyclomatic complexity of the method {Process()} is 22, it is over 20
ops/ops-nn/activation/swiglu_group_quant/op_host/swiglu_group_quant_infershape.cpp 65 the cyclomatic complexity of the method {InferShape4SwigluGroupQuant()} is 27, it is over 20

Environment Information / 环境信息 (Mandatory / 必填)

Ascend950

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

静态检查master分支代码

Describe the expected behavior / 预期结果 (Mandatory / 必填)

无语言规范问题

image.png

Special notes for this issue/备注 (Optional / 选填)

likedislike
高逸凡
高逸凡Collaborators
Sep 24 Comments:

/assign

likedislike
CANN-robotCANN-robotCollaborators
Sep 24 Assign yifangao as responsible person
高逸凡高逸凡Collaborators
Sep 24 Modify description of issue
高逸凡高逸凡Collaborators
Sep 24 Modify description of issue
高逸凡高逸凡Collaborators
Sep 24 Modify description of issue
高逸凡高逸凡Collaborators
Sep 24 Modify description of issue
高逸凡高逸凡Collaborators
Sep 24 changed custom state from 进行中 to 已完成
高逸凡高逸凡Collaborators
Sep 24 Close issue