已关闭
[Requirement|需求建议]: SIMT新增数据类型转换 #1584
ruoshuisixue创建于  9 天前关闭于  3 天前
ruoshuisixue成员
9 天前 创建

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

Background(背景信息)

SIMT 设备函数当前在 half、bfloat16_t 与部分整型之间的转换能力不完整,缺少 char、unsigned char、short、unsigned short 等小位宽整型相关接口,也缺少部分位重解释、打包、fp8 单元素转换和配套文档说明。

Origin(信息来源)

Benefit / Necessity (价值/作用)

补齐 SIMT 场景下低精度数据类型与整型之间的转换能力,覆盖 rn/rz/rd/ru 等舍入模式,提升 half、bfloat16_t、fp8 相关开发的接口完整性和易用性。该改动可减少开发者自行实现转换、边界钳位和位重解释逻辑的成本,降低精度处理和饱和处理不一致带来的风险,同时完善 API 文档与测试覆盖,便于后续维护和对外使用。

Design(设计方案)

在 include/simt_api 和 impl/simt_api 中新增并实现类型转换接口,主要包括:

  • half / bfloat16_t 到 char、unsigned char、short、unsigned short 的转换接口。
  • short、unsigned short 到 half / bfloat16_t 的反向转换接口。
  • __half_as_short、__half_as_ushort、__short_as_half、__bfloat16_as_short、__bfloat16_as_ushort、__short_as_bfloat16 等位重解释接口。
  • __float2half2_rn、__half2half2 等 half2 打包接口。
  • __asc_cvt_float_to_fp8 单元素 float 到 fp8 转换接口。
  • nanf、abs(float)、混合有符号/无符号 max/min 重载,以及 asc_stcg/asc_stwt 的 char 重载。

同步更新 SIMT API 列表和各新增接口的中文文档,并在 tests/api/simt_api/ascendc_case_ascend950pr_9599_simt 下增加类型转换、数学函数、设备函数相关单元测试,验证舍入模式、边界饱和、位重解释接口行为。

likedislike
Rruoshuisixue成员
9 天前 添加了label:requirement
Rruoshuisixue成员
9 天前 修改标题为 “[Requirement|需求建议]: SIMT新增数据类型转换”,原标题为“[Requirement|需求建议]: ”
Rruoshuisixue成员
7 天前 关联了pull request:SIMT:clean code
Rruoshuisixue成员
6 天前 关联了pull request:SIMT :clean code
Rruoshuisixue成员
3 天前 issue状态由 待办的 改变为 已解决
Rruoshuisixue成员
3 天前 关闭了 issue