Closed
grouped_matmul_swiglu_quant_v2 MXFP4 dtype校验需按weight format区分ND/NZ #3790
jayshuAdd on  Jul 16Closed at  Jul 16
jayshu
jayshuCollaborators
Jul 16 Create

问题描述

grouped_matmul_swiglu_quant_v2 的 MXFP4 场景中,ND 和 NZ weight format 对 DT_FLOAT4_E1M2 的支持范围不同,但现有 dtype 校验容易把两类场景混在同一套支持列表中处理。

具体表现:

  • MXFP4 ND 场景:x / weight / output 不应支持 DT_FLOAT4_E1M2,仅支持 DT_FLOAT4_E2M1。
  • MXFP4 NZ 场景:x / weight / output 可支持 DT_FLOAT4_E2M1 和 DT_FLOAT4_E1M2。
  • 若不按 weight format 区分,可能导致 ND 场景误放行 DT_FLOAT4_E1M2,或 NZ 场景误拦截合法输入。

期望修改

  • 拆分 MXFP4 ND/NZ 的 dtype 支持列表。
  • CheckFp4DtypeValid 根据 weight storage format 选择对应的 x / weight / output dtype 支持列表。
  • CheckDtypeValid 的前置判断同步按 ND/NZ 区分。
  • 保留 ND + DT_FLOAT4_E1M2 场景的标准 error message 上报。
  • 补充 op_api CSV 用例覆盖 NZ E1M2 valid 和 ND E1M2 invalid 场景。

关联PR

https://gitcode.com/cann/ops-transformer/pull/8787

likedislike
jayshujayshuCollaborators
Jul 16 changed custom state from 进行中 to 已完成
jayshujayshuCollaborators
Jul 16 Close issue
CANN-robotCANN-robotCollaborators
Jul 16 Added label: Accepted
CANN-robotCANN-robotCollaborators
Jul 17 Added label: resolved
周云飞
周云飞Collaborators
19 days ago Comments:

/assign @jayshu

likedislike
CANN-robotCANN-robotCollaborators
19 days ago Assign jayshu as responsible person