已合并
fix: prevent unsupported data types from migrating to HostCPU #4523
ZhuXincheng创建于 5 天前
fix: prevent unsupported data types from migrating to HostCPU #4523
已合并
ZhuXincheng创建于 5 天前
ZhuXincheng
ZhuXincheng成员
5 天前

背景

HostCPU 执行包含 DT_STRING 数据的节点时,字符串 Tensor 的 GE 内存布局与 HostCPU/Eigen 侧的字符串处理方式不一致,可能在 EqualHostKernel 中触发段错误。

变更内容

HostcpuEngineUpdatePass 中增加防御性检查:

  • 检查节点的所有输入和输出 Tensor 数据类型;
  • 对包含以下数据类型的节点禁止迁移到 HostCPU:
    • DT_STRING
    • DT_STRING_REF
    • DT_VARIANT
    • DT_RESOURCE
  • 保持原有 HostCPU 迁移逻辑不变,其他数据类型仍按算子支持情况正常判断。

变更类型

如何测试

  1. 构造输入或输出包含上述不支持数据类型的节点,执行 HostcpuEngineUpdatePass
  2. 确认节点保持在原设备执行引擎,不迁移到 HostCPU。
  3. 使用普通数值类型节点回归,确认满足 HostCPU 算子注册和迁移条件时仍可正常迁移。

影响范围

仅影响 HostCPU 节点迁移判定,不改变算子实现及其他执行引擎的行为。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 ZhuXincheng 的贡献)
ZhuXinchengZhuXincheng成员
5 天前 添加了label:enhancement
ZhuXinchengZhuXincheng成员
5 天前 创建了 pull request,commit e4f3cf07
CANN-robotCANN-robot成员
5 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
5 天前 评论:

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
repo-cann/ge 张德鹏, yangyongqiang0606, kobemini (3/2) 张德鹏 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
5 天前 将yangyongqiang0606,kobemini,ClarkXie,tangqunzhang,xchu42,hugo111,lining23666,fu-jun2,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,zhanj,zhujingjing,Mexyy,wangxiaotian995,stevenaw0,yuht9设为评审人
此处折叠了47条消息 查看更多
yangyongqiang
yangyongqiang成员
4 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
4 天前 添加了label:lgtm
张德鹏成员
4 天前 评论:

/approve

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