已关闭
[Requirement|需求建议]: add external op task framework integration #429
su-yueming创建于 9月18日关闭于 9月20日
9月18日 添加了label:requirement
9月18日 将 su-yueming 设为负责人
Ssu-yueming
9月18日 修改标题为 “[Requirement|需求建议]: add external op task framework integration”,原标题为“[Requirement|需求建议]: ”
9月18日 修改标题为 “[Requirement|需求建议]: add external op task framework integration”,原标题为“[Requirement|需求建议]: ”
9月20日 关闭了 issue
9月20日 添加了label:resolved
9月29日 关联了pull request:feat(opdev): add external op task framework integration
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
需求功能 :为 opdev 层新增外部算子任务接入框架(Direct Invoke Task),提供 AddDirectInvokeTask SPI 接口,允许算子实现方以 prepare / launch / destroy 三个回调的方式,将自定义计算任务挂接到 ACLNN 两阶段执行框架( aclOpExecutor )中。
解决的问题 :此前外部/自定义算子要接入 ACLNN 执行体系,必须走 AI Core kernel launcher 或描述符式的老接口,无法覆盖"实现方自行管理 kernel 下发、tiling、workspace"的场景。新接口解决了以下问题:
Origin(信息来源)
算子开发
Benefit / Necessity (价值/作用)
Design(设计方案)
总体思路:在 opdev 层新增 Direct Invoke 任务类型( KernelLauncher 子类 DirectInvokeKernelLauncher ,launcher 类型 DIRECT_INVOKE ),以三回调 SPI 替代原描述符式接口(不保留旧 ABI 兼容)。
接口定义 ( direct_invoke_task.h ):
注册流程 ( direct_invoke_task.cpp ):
执行流程 : DirectInvokeKernelLauncher::Launch() 恢复注册时捕获的 TLS L0 上下文 → 输入 dump → 调用 launch_(launchState, args, stream) → 输出 dump → 成功后按需溢出检测(模型捕获场景跳过)。
关键设计约束 :
配套改动 :新增 AddDirectInvokeTask.md 接口文档、opbase.xml 打包清单、stub 生成(gen_stubapi.py),以及 944 行 UT( test_direct_invoke.cpp )覆盖参数校验、失败路径资源回收、workspace 分配、repeat 与缓存禁用等场景。