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

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。
  • 支持 rank 1~8 与空 Tensor;不修改现有 op_graph 原型契约。

Design(设计方案)

  1. op_host/arch35/ascend_dequant_tiling.{cpp,h}:参数校验、广播校验与归一化、UB/多核切分,按原始 rank 选择 tilingKey(0: rank≤4,1: rank 5–8)。
  2. op_host/ascend_dequant_infershape.cpp:InferShape(y.shape == x.shape)与 InferDataType(按 dtype 给出 fp16/fp32)。
  3. op_kernel/ascend_dequant_apt.cpp + op_kernel/arch35/*:NDDMA 广播搬运 + regbase VF 计算链,fp32 输出直通、fp16 单次舍入。
  4. op_host/config/{ascend950,ascend350,ascend960dt}/ascend_dequant_binary.json:每个 SoC 配置 fp16 / fp32 输出两条 kernel。
  5. 补齐 Host / Kernel UT 与中英文 README。
likedislike
田野田野Collaborators
5 days ago Added label: requirement
田野
田野Collaborators
5 days ago Comments:

/assign

likedislike
CANN-robotCANN-robotCollaborators
5 days ago Assign transformer910 as responsible person
yuning_chen
yuning_chenCollaborators
5 days ago Comments:

收到需求建议,欢迎您参加 ops-nn sig 例会评审并申报相关议题,最近的例会议题申报及会议时间可见:https://etherpad-cann.meeting.osinfra.cn/p/sig-ops-nn

本条要点: Backgroud(背景信息)

likedislike
CANN-robotCANN-robotCollaborators
3 days ago Close issue
CANN-robotCANN-robotCollaborators
3 days ago changed custom state from 待办的 to 已完成
CANN-robotCANN-robotCollaborators
3 days ago Added label: resolved
田野田野Collaborators
2 days ago Associated pull request