已关闭
[Requirement|需求建议]: Feat: 新增面向arch35的aclblasDotEx接口 #307
Sun创建于  7月10日关闭于  7月14日
Sun
Sun成员
7月10日 创建

Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.

Backgroud(背景信息)

BLAS Level-1 接口 aclblasDotEx 用于计算扩展精度向量点积:

result = sum(x[i * incx] * y[i * incy]),  i = 0 ... n-1

支持 FP32/FP16/BF16 三种数据类型组合,内部统一以 FP32 精度计算,结果类型与输入类型一致。具体支持:

x 类型 y 类型 result 类型 计算精度
FP32 FP32 FP32 FP32
FP16 FP16 FP16 FP32
BF16 BF16 BF16 FP32

本需求要求面向 arch35(Ascend 950) 实现 aclblasDotEx,并补齐对应测试。

Origin(信息来源)

由 ops-blas 算子工程团队提出,对应于 arch35(Ascend 950)算子补齐计划中的 BLAS Level-1 扩展精度 dot 算子项。

Benefit / Necessity (价值/作用)

  • 补齐 arch35 平台 BLAS Level-1 扩展点积接口能力,使上层应用(科学计算、AI 框架后端)能在 Ascend 950 上完成混合精度内积计算
  • 双路径:|inc|=1 走 SIMD 路径,其余走 SIMT grid-stride 通用路径
  • FP16/BF16 输入场景下 FP32 中间累加,兼顾存储效率与计算精度

Design(设计方案)

接口签名:

aclblasStatus_t aclblasDotEx(aclblasHandle_t handle, int n,
    const void* x, aclDataType xType, int incx,
    const void* y, aclDataType yType, int incy,
    void* result, aclDataType resultType, aclDataType executionType);

双路径设计:

条件 路径 说明
incx == incy && abs(incx) == 1 SIMD regbase Mul + ReduceSum 向量化,多核切分 + 跨核归约
其余情况 SIMT grid-stride 各线程写 per-thread 槽位 + asc_syncthreads + thread 0 归约 → 跨核同步 → Core 0 ReduceSum
likedislike
SunSun成员
7月10日 添加了label:requirement
SunSun成员
7月10日 将 LuckySun 设为负责人
SunSun成员
7月10日 修改了issue 的描述
SunSun成员
7月14日 修改了issue 的描述
SunSun成员
7月14日 修改了issue 的描述
SunSun成员
7月14日 修改了issue 的描述
CANN-robotCANN-robot成员
7月14日 关闭了 issue
CANN-robotCANN-robot成员
7月14日 添加了label:resolved
SunSun成员
7月17日 修改了issue 的描述