已关闭
[Bug-Report|缺陷反馈]: 【PR】: sync develop to master 0829这笔提交引入不兼容 #102
chenqi317创建于  9月1日关闭于  9月18日
chenqi317
9月1日 创建

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

Describe the current behavior / 问题描述 (Mandatory / 必填)

使用今天toolkit编译出的算子包 配套昨天的toolkit包执行
GenSimplifiedKeyKernelFunc 符号找不到
https://gitcode.com/cann/metadef/pull/455/diffs 这笔提交引入

Environment / 环境信息 (Mandatory / 必填)

A5

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

使用今天toolkit编译出的算子包 配套昨天的toolkit包执行
GenSimplifiedKeyKernelFunc 符号找不到

Describe the expected behavior / 预期结果 (Mandatory / 必填)

不应该存在版本不兼容变更

GenSimplifiedKeyKernelFunc 符号找不到

Special notes for this issue/备注 (Optional / 选填)

likedislike
Cchenqi317
9月1日 issue类型由 任务 改变为 缺陷
Cchenqi317
9月1日 修改了issue 的描述
Sspring_yb成员
9月1日 将 chenqian1365 设为负责人
chenqian1365成员
9月1日 评论:

感谢反馈。经源码分析确认,该问题确实由 PR #455 引入,根因已定位。

根因

PR #455(sync develop to master 0829)中的提交 bd2bb7f(feat: support GenSimplifiedKey registration through OpDef)做了两处关键变更:

  1. 在随 toolkit 发布的对外头文件 inc/external/asc/register/op_def_registry.h 的 OP_ADD 算子注册宏中,新增一行注册调用:impl.GenSimplifiedKey(op.AICore().GetGenSimplifiedKey());
  2. OpAICoreDef::GetGenSimplifiedKey() / SetGenSimplifiedKey() 两个方法为该提交新增(实现在 base/asc/opdef/op_def_aicore.cc,编入 toolkit 运行库)。

不兼容机制

  • 使用新 toolkit 编译、且采用 OP_ADD 宏注册的算子包 .so,在加载时会调用 OpAICoreDef::GetGenSimplifiedKey(),从而产生对该符号的引用;
  • 旧 toolkit 的运行库由该提交之前的源码构建,不含此符号 → 动态链接解析失败,报 GenSimplifiedKey 相关符号找不到。
  • 这与您描述的场景(今天 toolkit 编译的算子包 + 昨天 toolkit 执行)完全对应:PR #455 于 08-31 17:24 合入 master,恰好落在两次每日构建之间。

影响范围

使用含 PR #455 的 toolkit 编译、且经 OP_ADD 宏注册的算子包,在任何不含该提交的运行环境上加载均会失败(不限"昨天"的版本)。

后续

该变更在对外注册宏中引入了跨版本符号依赖,破坏了算子包对旧版 toolkit 的兼容性。我们将评估处理方案(回退该宏变更或改为兼容式实现),确定后在本 issue 更新。

如方便,请提供报错的完整 undefined symbol 原文(mangled 或 demangled 字符串),便于精确确认失败符号;不影响上述根因结论。

likedislike
Cchenqian1365成员
9月18日 关联了pull request:fix: avoid OP_ADD ABI dependency on simplified key
Cchenqian1365成员
9月18日 issue状态由 待办的 改变为 已完成
Cchenqian1365成员
9月18日 关闭了 issue
CANN-robotCANN-robot成员
9月18日 添加了label:resolved