Closed
[Requirement|需求建议]: [ascend_dequant] 补齐 AscendDequant 的 AscendC(arch35) 实现(int32 + uint64 → float16/float32) #8875
田野Add on 5 days agoClosed at 3 days ago
5 days ago Added label: requirement
田野
5 days ago Comments:
5 days ago Comments:
/assign


5 days ago Assign transformer910 as responsible person
yuning_chen
5 days ago Comments:
5 days ago Comments:
收到需求建议,欢迎您参加 ops-nn sig 例会评审并申报相关议题,最近的例会议题申报及会议时间可见:https://etherpad-cann.meeting.osinfra.cn/p/sig-ops-nn
本条要点: Backgroud(背景信息)


3 days ago Close issue
3 days ago changed custom state from 待办的 to 已完成
3 days ago Added label: resolved
2 days ago Associated pull request
Backgroud(背景信息)
quant/ascend_dequant当前仅有算子定义、图原型与框架插件,缺少 AscendC 实现(docs/zh/op_list.md中标注为"该算子暂无 Ascend C 代码实现"),在 arch35(Ascend 950/350/960dt)上无法完成反量化计算,模型侧涉及 int32 激活 + 逐通道/逐 tensor scale 的反量化场景无法落图执行。Origin(信息来源)
vector
Benefit / Necessity (价值/作用)
AscendDequant,输入x(INT32)、deq_scale(UINT64),输出y(FLOAT16或FLOAT32,由属性dtype选择)。y = cast_to_dst_type(fp32(x) * s [→relu] [* s]),其中s = reinterpret_f32(deq_scale 低 32 位);relu_flag的 ReLU 位于两次乘法之间;sqrt_mode为再乘一次同一 scale(s²)。deq_scale需支持 numpy 右对齐广播 到x(per-tensor 长度 1 / 1-D 末维 / 部分维为 1),y.shape == x.shape。op_graph原型契约。Design(设计方案)
op_host/arch35/ascend_dequant_tiling.{cpp,h}:参数校验、广播校验与归一化、UB/多核切分,按原始 rank 选择 tilingKey(0: rank≤4,1: rank 5–8)。op_host/ascend_dequant_infershape.cpp:InferShape(y.shape == x.shape)与InferDataType(按dtype给出 fp16/fp32)。op_kernel/ascend_dequant_apt.cpp+op_kernel/arch35/*:NDDMA 广播搬运 + regbase VF 计算链,fp32 输出直通、fp16 单次舍入。op_host/config/{ascend950,ascend350,ascend960dt}/ascend_dequant_binary.json:每个 SoC 配置 fp16 / fp32 输出两条 kernel。