已关闭
[Bug-Report|缺陷反馈]: FlatQuant算子缺少对非法p2矩阵的拦截 #2582
yushan-kite创建于 5月8日关闭于 5月9日
5月8日 添加了label:bug-report
yushan-kite
5月8日 评论:
5月8日 评论:
/assign


5月8日 将 yushan-kite 设为负责人
5月8日 关联了pull request:fix p2 check
5月9日 关闭了 issue
5月9日 添加了label:resolved
/assign


Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
FlatQuant算子在mxfp4场景下,目前p2矩阵仅支持shape为(0,0)或(N,N),当前缺少对(0,N)和(N,0)等非法输入的拦截,需要增加拦截。
Environment / 环境信息 (Mandatory / 必填)
Ascend950
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
import torch
import torch_npu
K=16
M=64
N=64
x=torch.randn(K,M,N).half().npu()
p1=torch.randn(M,M).half().npu()
p2=torch.randn(0,N).half().npu()
print("p2.shpae: ",p2.shape)
clip_ratio=1.0
dst_dtype = torch_npu.float4_e2m1fn_x2
out, quant_scale = torch_npu.npu_kronecker_quant(x,p1,p2,clip_ratio,dst_dtype)
这里计算是没有拦截非法的p2
Describe the expected behavior / 预期结果 (Mandatory / 必填)
在p2是非法shape的时候,通过tiling拦截。
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
p2.shape异常的情况下没有拦截到
Special notes for this issue/备注 (Optional / 选填)