基于领域知识图谱的框架间AI源码自动迁移
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

科技创新2030—“新一代人工智能”重大项目(2021ZD0110600); 百度合作项目(Z231100010323007); 华为合作项目(22081500805582B)


Automatic Migration of AI Source Code Between Frameworks Based on Domain Knowledge Graph
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    作为人工智能的基础设施, 深度学习框架已经成为人工智能实现跨越发展的重要突破口. 但是由于缺乏统一标准, 不同框架的兼容水平较差. 忠实模型转换通过将源模型迁移为另一种目标框架下的等价模型, 来增强框架间的互操作性. 然而, 深度学习框架数量较多且相互间差异较大, 并且自主框架的需求逐渐增多, 互相转换成本较高. 因此, 提出基于领域知识图谱的框架间AI源码自动迁移方法. 该方法基于领域知识图谱和抽象语法树来系统地处理迁移挑战, 首先将源代码转换为特定的抽象语法树, 提取通用依赖信息和特定算子信息, 然后再利用存储在领域知识图谱中的框架间算子及参数映射关系来迁移到目标框架下, 形成目标框架下的目标模型代码, 大大降低了工程复杂度. 对比同类型的代码迁移工具, 所提方法可以在国内外流行深度学习框架如PyTorch、PaddlePaddle和MindSpore之间进行互相迁移, 达到了较好的成熟度和质量, 部分成果已经开源到百度官方迁移工具PaConvert中.

    Abstract:

    As the foundation of AI, deep learning frameworks play a vital role in driving the rapid progress of AI technologies. However, due to the lack of unified standards, compatibility across different frameworks remains limited. Faithful model transformation enhances interoperability by converting a source model into an equivalent model in the target framework. However, the large number and diversity of deep learning frameworks, combined with the increasing demand for custom frameworks, lead to high conversion costs. To address this issue, this study proposes an automatic AI source code migration method between frameworks based on a domain knowledge graph. The method integrates domain knowledge graphs and abstract syntax trees to systematically manage migration challenges. First, the source code is transformed into a framework-specific abstract syntax tree, from which general dependency information and operator-specific details are extracted. By applying the operator and parameter mappings stored in the domain knowledge graph, the code is migrated to the target framework, generating equivalent target model code while significantly reducing engineering complexity. Compared with existing code migration tools, the proposed method supports mutual migration among widely used deep learning frameworks, such as PyTorch, PaddlePaddle, and MindSpore. The approach has proven to be both mature and reliable, with part of its implementation open-sourced in Baidu’s official migration tool, PaConvert.

    参考文献
    相似文献
    引证文献
引用本文

丁嵘,刘屹洲,王雨倩,李一錡.基于领域知识图谱的框架间AI源码自动迁移.软件学报,2026,37(2):584-600

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2024-06-06
  • 最后修改日期:2024-08-07
  • 录用日期:
  • 在线发布日期: 2025-09-24
  • 出版日期: 2026-02-06
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号