已合并
WriteGmByPassDCache和ReadGmByPassDCache接口名称问题修改 #5327
WriteGmByPassDCache和ReadGmByPassDCache接口名称问题修改 #5327
已合并
chenmyk创建于 20 天前
chenmyk成员
20 天前

描述

WriteGmByPassDCache和ReadGmByPassDCache接口名称问题修改
提供新接口并提示原接口废弃

关联的Issue

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 chenmyk 的贡献)
Cchenmyk成员
20 天前 创建了 pull request,commit 2d92aaf3
atomgit-bot
atomgit-bot
20 天前 评论:

变更摘要

本 PR 主要修复 WriteGmByPassDCacheReadGmByPassDCache 接口命名不规范("ByPass" 应为 "Bypass")的问题:新增命名正确的接口 WriteGmBypassDCacheReadGmBypassDCache 作为替代,并将原接口通过 [[deprecated]] 属性标记为废弃,提示将于 2028 版本移除;同时对底层实现函数进行相应重命名,并针对 2201 架构补充写操作的地址对齐调试断言。

主要改动

  • 新增正确命名接口:在 kernel_operator_scalar_intf.h 中声明、在 kernel_operator_scalar_intf_impl.h 中实现新接口 WriteGmBypassDCacheReadGmBypassDCache,作为原接口的替代方案。
  • 标记原接口废弃:为 WriteGmByPassDCacheReadGmByPassDCache 增加 [[deprecated]] 属性并提示于 2028 版本移除,其内部实现改为调用新的 WriteGmBypassDCacheImpl/ReadGmBypassDCacheImpl
  • 实现函数重命名:在 kernel_scalar.h 中将实现函数 WriteGmByPassDCacheImplReadGmByPassDCacheImpl 分别重命名为 WriteGmBypassDCacheImplReadGmBypassDCacheImpl
  • 新增地址对齐调试断言:在 WriteGmBypassDCacheImpl 中针对 __NPU_ARCH__ == 2201 增加 ASCENDC_DEBUG_ASSERT,校验 addr 在 128 字节对齐范围内的偏移小于 32(写入仅在该范围前 32 字节生效),并输出对应的错误日志。
likedislike
不准确?
atomgit-bot
atomgit-bot
20 天前 评论:

代码审查

关闭总结

各变更文件审查确认

  • impl/basic_api/kernel_operator_scalar_intf_impl.h — 已审查。发现 1 个 P0 问题:新增的 WriteGmBypassDCache 函数(第 97 行)缺失 template <typename T> 声明,直接导致 2201/3510/5102 架构编译失败;另含 1 处 [[deprecated]] 放在 template 之前的属性位置问题(并入 include 头的 P3 发现)。
  • impl/basic_api/kernel_scalar.h — 已审查。改名(WriteGmByPassDCacheImplWriteGmBypassDCacheImplReadGmByPassDCacheImplReadGmBypassDCacheImpl)在可检索范围内引用一致、无残留旧名调用;新增的 2201 架构 ASCENDC_DEBUG_ASSERT 断言块(地址 128 字节对齐范围内偏移 <32)语义与宏用法均正确,%u 格式符与 uint32_t 实参匹配。发现 1 个 P3 低风险问题:static_assert 错误信息仍引用旧接口名。
  • include/basic_api/kernel_operator_scalar_intf.h — 已审查。新接口声明完整、签名与 impl 定义匹配。发现 1 个 P3 问题:两处 [[deprecated]] 均置于 template <typename T> 之前(偏离仓库既有惯例,ReadGmByPassDCache 的废弃告警可能不生效)。

审查结论

共报告 3 个问题:P0 × 1、P3 × 2。

总体风险评估:本 PR 存在一个 P0 级构建失败缺陷——WriteGmBypassDCache 缺少模板声明,所有在 2201/3510/5102 架构下包含该公共头的算子代码将无法编译,必须修复后才能合入。两个 P3 问题(deprecated 属性位置导致 ReadGmByPassDCache 废弃提示不生效、static_assert 信息残留旧名)属于次要一致性问题,不影响运行正确性,但建议一并修正以达成 PR「提示原接口废弃」的目标。改名后的新老接口调用链(wrapper → *BypassDCacheImpl)在可检索范围内保持一致,无其他正确性风险。

类型 数量
🔴 阻塞 1
🟡 建议 0

⛔ 需要修改

likedislike
不准确?
CANN-robotCANN-robot成员
20 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
20 天前 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
docs bianque, munanhw, wuyang_hw (3/2) munanhw, bianque (2/1)
examples bianque, munanhw, wuyang_hw (3/2) bianque, munanhw (2/1)
impl/basic_api wuyang_hw, bianque (2/2) wuyang_hw (1/1)
include/basic_api wuzhaolin, wuyang_hw, bianque (3/2) wuzhaolin (1/1)
repo-cann/asc-devkit bianque, wuyang_hw (2/2) wuyang_hw, bianque (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

chenmyk, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
此处折叠了204条消息 查看更多
CANN-robotCANN-robot成员
10 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
10 天前 添加了label:ci-pipeline-passed
bianque成员
10 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
10 天前 添加了label:lgtm
CANN-robotCANN-robot成员
10 天前 合入了pull request