已合并
refactor(modulate): A5(arch35) Reg 加载存储接口升级为 LoadAlign/StoreAlign #9990
refactor(modulate): A5(arch35) Reg 加载存储接口升级为 LoadAlign/StoreAlign #9990
已合并
Nice try创建于 25 天前
Nice try
Nice try成员
25 天前

描述

将 vfusion 融合版 Modulate 算子 A5(arch35,Ascend 950)侧的 Reg 实现路径接口升级到新的 Reg 加载/存储接口与 UB 地址空间限定符。

改动原因

vfusion/modulate 的 A5(arch35)Reg 路径代码中使用了旧的地址空间限定符 __local_mem__ 与旧的 Reg 加载/存储接口 Reg::DataCopy,需要升级为新接口以适配当前工具链与接口规范。

改动方法

仅修改 vfusion/modulate/op_kernel/arch35/modulate_regbase_common.h,覆盖 ModulateBaseKernel 的 ComputeScaleShift / ComputeScale / ComputeShift 三个函数:

  • 将 x/scale/shift/y 的 LocalTensor::GetPhyAddr() 指针强转由 __local_mem__ T* 改为 __ubuf__ T*;
  • Reg 加载接口由 Reg::DataCopy<T, Reg::LoadDist::DIST_NORM> 改为 Reg::LoadAlign<T, Reg::LoadDist::DIST_NORM>;
  • Reg 存储接口由 Reg::DataCopy<T, Reg::StoreDist::DIST_NORM> 改为 Reg::StoreAlign<T, Reg::StoreDist::DIST_NORM>。

关联的Issue

测试

本次改动未新增/修改测试文件,未涉及算子功能逻辑变更;依赖仓库既有 CI 流水线验证(PR 已附带 ci-pipeline-passed 标签)。

文档更新

无,本次改动不涉及文档。

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Nice try 的贡献)
Nice tryNice try成员
25 天前 创建了 pull request,commit 85e570b7
atomgit-bot
atomgit-bot
25 天前 评论:

变更摘要

本 PR 升级 A5(arch35)平台上 modulate 算子的寄存器级接口:在 modulate_regbase_common.h 的 ModulateBaseKernel 中,将针对 xLocal、scaleLocal、shiftLocal、yLocal 物理地址的指针类型从 __local_mem__ 改为 __ubuf__,并把寄存器数据搬运接口 Reg::DataCopy 升级为对齐版本的 Reg::LoadAlign / Reg::StoreAlign(仍使用 DIST_NORM 分布),属于同增减行数的对等接口替换。

主要改动

  • 指针类型切换为 __ubuf__:在 ComputeScaleShift、ComputeScale、ComputeShift 三个函数中,将 xAddr、scaleAddr、shiftAddr、yAddr 的地址指针声明由 (__local_mem__ T*) 改为 (__ubuf__ T*),与新的接口语义保持一致。
  • 加载接口升级:将各处理流程中的 Reg::DataCopy<T, Reg::LoadDist::DIST_NORM> 全部替换为 Reg::LoadAlign<T, Reg::LoadDist::DIST_NORM>,用于从 scale/shift/x 地址加载数据到寄存器。
  • 存储接口升级:将写回结果的 Reg::DataCopy<T, Reg::StoreDist::DIST_NORM> 替换为 Reg::StoreAlign<T, Reg::StoreDist::DIST_NORM>,完成 scale+shift、纯 scale、纯 shift 三种计算路径中寄存器数据的对齐存储。
likedislike
不准确?
atomgit-bot
atomgit-bot
25 天前 评论:

代码审查

✅ 未发现问题

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

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
vfusion ✅ 汤平川, 钱泽洪 (2/2) ✅ 汤平川, 钱泽洪 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
25 天前 将zengjuan,chenfeng61,chaotang233,crystalhu,yu-xinjie62,yangyang016,fanqirui,su-yueming,chenqi317,wang-xing001,liubo75,tangweiwei2,pingchuantang,qianzehong设为评审人
CANN-robotCANN-robot成员
25 天前 将chenfeng61,yu-xinjie62,su-yueming,wang-xing001,pingchuantang,qianzehong设为审查人
Nice try
Nice try成员
25 天前 评论:

compile

likedislike
Nice tryNice try成员
25 天前 预合并成功(commit_id: e89d9d65af42d6840d69b92475c9559264ed9470)
CANN-robot
CANN-robot成员
25 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
25 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
25 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
25 天前 添加了label:ci-pipeline-passed
yuning_chen
yuning_chen成员
25 天前 评论:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!

likedislike
Nice tryNice try成员
24 天前 修改标题为 “refactor(modulate): A5(arch35) Reg 加载存储接口升级为 LoadAlign/StoreAlign”,原标题为“upgrade interface of modulate in A5”
Nice tryNice try成员
24 天前 修改了pull request 的描述
TangPC
TangPC成员
24 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
24 天前 添加了label:approved
qianzehong成员
24 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
24 天前 添加了label:lgtm
CANN-robotCANN-robot成员
24 天前 关闭了关联的issue
CANN-robotCANN-robot成员
24 天前 合入了pull request