已关闭
[Bug-Report|缺陷反馈]: wqbmmv2 uint8承载antiquantScale修正仅覆盖float32承载weight,float4_e2m1 weight场景报161002 #5709
马琦钧创建于 27 天前关闭于 19 天前
27 天前 关联了pull request:fix: wqbmmv2 uint8承载antiquantScale修正适配float4_e2m1 weight场景
27 天前 将 maqijun 设为负责人
19 天前 修改了issue 的描述
19 天前 关闭了 issue
19 天前 添加了label:resolved
19 天前 关联了pull request:docs: wqbmmv2 补充 uint8 承载 float8_e8m0 antiquantScale 文档与 example
Describe the current behavior / 问题描述 (Mandatory / 必填)
matmul/weight_quant_batch_matmul_v2/op_host/op_api/aclnn_weight_quant_batch_matmul_v2.cpp的TensorPreProcess中,microscaling 场景采用 uint8 承载 float8_e8m0 数据时,需将 antiquantScale 的 dtype 由 uint8 修正为 float8_e8m0。原修正条件为:if (op::GetCurrentPlatformInfo().GetCurNpuArch() == NpuArch::DAV_3510 && weight->GetDataType() == DataType::DT_FLOAT && antiquantScaleRef->GetDataType() == DataType::DT_UINT8)仅覆盖 weight 为 float32 承载 float4_e2m1 的场景。当 weight 直接为
ACL_FLOAT4_E2M1(如 weight_quant_preprocess MX 转置 ND 直拷后的输出)且 antiquantScale 以ACL_UINT8传入时,修正不生效,antiquantScale 保持 uint8,后续 CheckDtypeValid 的 DAV3510_ANTIQUANT_SCALE_DTYPE_SUPPORT_LIST 白名单(float16/bfloat16/float8_e8m0)校验失败,aclnnWeightQuantBatchMatmulV2GetWorkspaceSize 返回 161002 (ACLNN_ERR_PARAM_INVALID)。Environment / 环境信息 (Mandatory / 必填)
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
x(FLOAT16, {16,256}) + weight(FLOAT4_E2M1, {256,128}, ND) + antiquantScale(UINT8, {8,128}) + antiquantGroupSize=32 直调 aclnnWeightQuantBatchMatmulV2GetWorkspaceSize,返回 161002。
Describe the expected behavior / 预期结果 (Mandatory / 必填)
weight 直接为 float4_e2m1 时同样执行 uint8 -> float8_e8m0 的 antiquantScale dtype 修正(uint8 与 float8_e8m0 均为 1 字节,仅修正 dtype 不影响 shape),GetWorkspaceSize 返回成功且结果精度正确。
对应 PR:https://gitcode.com/cann/ops-nn/pull/10133