Closed
[Requirement|需求建议]: QuantBatchMatmul 算子 FP8-Pertile 支持 WeightNZ #3484
Nam_JohnAdd on Jun 22Closed at Jul 6
Jun 22 Associated pull request
Jun 22 Modify description of issue
Jun 22 Assign Nam_John as responsible person
Jul 6 Close issue
Jul 6 Added label: resolved
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
quantBatchMatmulV3算子的mx量化以及纯cube模板已支持weightNz(FORMAT_FRACTAL_NZ),剩余MIX模板(PerToken量化 + 浮点scale)以及PerTile模板尚未支持。本次修改让这PerTile模板也能处理weightNz格式的权重矩阵,kernel与通路同时支持。
Origin(信息来源)
matmul
Benefit / Necessity (价值/作用)
这PerTile模板也能处理weightNz格式的权重矩阵
Design(设计方案)
PerTile模板:需要在CMCT低级API调用时通过layout参数传递weightNz属性(Cmct::Gemm::layout::Nz),底层BlockMmadPertile处理NZ格式的地址计算。
Tiling层:PerTile的IsCapable()需放开FORMAT_FRACTAL_NZ。
Kernel层:新增方法 CopyInB1WeightNz;B batch 基址偏移按 NZ 对齐计算。
aclnn层:CheckWeightNzDtype4Fp8E4M3()需放开FLOAT32 scale + pertoken组合。
尾轮切分:N轴对齐到16(transB=True)或32(transB=False),现有IsInValidWeighNzTailSplit()已有此保护。