news 2026/9/10 22:35:26

昇腾GE历史注册协议设计

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
昇腾GE历史注册协议设计

History Registry Protocol

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

1. Positioning and Responsibility Boundaries

The history registry is along-term maintained protocol and data artifactused toarchive operator IR prototype information across versionsand provide query capabilities externally in a stable manner.

This protocol focuses on:

  • What the data is (field semantics and constraints)
  • Where the data is stored (directories and packaging)
  • How data is generated and published (currently generated bygen_esband published with Ops run package)
  • How consumers read it (file system interface)
  • How the protocol evolves (backward compatibility rules)

This protocol does not focus on:

  • Compatibility judgment/business decision logic

2. Terminology

  • IR Prototype: Operator's input/output/attribute/subgraph definition information at the IR layer.
  • Historical Prototype Data (Structured Data): The collection of data files after IR prototype extraction and serialization.
  • Producer: Tool that generates structured data. Currently fixed asgen_esb --extract-historyin the short term.
  • Consumer: Any tool/process that reads structured data. Currently the main consumer isgen_esb(for ES API generation), can be extended to other toolchains in the future.
  • Ops Run Package: Ops runtime package form after installation, historical prototype library data is published with it.
  • Compatibility Window: The version range that consumers select based on version metadata (e.g., release dates) for comparison/generation (e.g., "one-year window").

3. Directory Structure and Packaging

The historical prototype library is published with Ops run package and organized by operator packages (such asmath/nn/cv/...).

Directory structure (example, after installation):

/${CANN_INSTALL_PATH}/cann/opp/history_registry/<pkg>/ ├── index.json └── registry/ ├── <release_version_1>/ │ ├── operators.json │ └── metadata.json ├── <release_version_2>/ │ ├── operators.json │ └── metadata.json └── ...

Notes:

  • <pkg>: Package name, such asmath,nn,cv.
  • <release_version_x>: Version directory name, recommended to be consistent withmetadata.json.release_version(e.g.,8.0.RC1).

4. Files and Data Formats

This protocol contains three file types:

  • index.json: Version index (which versions are available in this package)
  • registry/<ver>/metadata.json: Version metadata (for selecting version range, traceability)
  • registry/<ver>/operators.json: Operator prototype data for that version

4.1 index.json (Version Index)

Minimum fields:

  • version: Index file schema version (string)
  • releases[]: Version array
    • release_version: Version number (string)
    • release_date: Release date (string, recommendedYYYY-MM-DD)

Example see Appendix A.

4.2 metadata.json (Version Metadata)

Recommended fields (minimum usable + extensible):

  • release_version: Version number
  • branch_name: Branch name (optional, but recommended to provide)

Example see Appendix A.

4.3 operators.json (Operator Prototype Data)

Minimum fields:

  • operators[]
    • op_type
    • inputs[]: Each item must contain at leastname/type/dtype
    • outputs[]: Each item must contain at leastname/type/dtype
    • attrs[]: Each item must contain at leastname/type/required, can includedefault_value
    • subgraphs[]: Each item must contain at leastname/type

Constraint recommendations:

  • default_valueuses string to carry "JSON literal text", needs to be parsed in combination withtype; used for cross-language consistency and to avoid numerical precision/large integer representation issues.

Example see Appendix A.

5. Generation and Publication (Currently Fixed by gen_esb)

In the short term, to reduce system complexity:

  • Producer: Still reusesgen_esb, extracts IR prototypes from "current version prototype .so" through--extract-historyand outputs structured data.

5.1 Data Flow for Building Ops Package (Generation and Packaging Publication)

Prerequisites:

  • Build environment needs to install Ops package (historical prototype data comes from installed Ops run package); if no Ops package, cannot obtain historical prototype data.

Ops package build data flow diagram:

Notes:

  • Historical prototype information of each version exists in Ops run package, stored in different packages (such asmath/nn/cv).

Simplified data flow diagram:

Generation mode (example):

gen_esb --extract-history --output-dir <out> --release-version <ver>

Publication principles:

  • Generate and archive this version's data before official version release.
  • Structured data is packaged and published with Ops run package.

6. Consumption Method (File System Interface)

Consumers read in the following manner:

  • Read<pkg>/index.jsonto get available version list and release dates
  • Select target version set (e.g., "one-year window")
  • Readregistry/<ver>/operators.jsonandmetadata.jsonto get prototypes and metadata

Note:

  • Protocol layer does not bind to any specific consumption strategy; consumption strategy (e.g., which overloads to generate, how to disambiguate) is implemented by consumers.

7. Protocol Evolution and Backward Compatibility

Principles:

  • Preferadding new fields, avoid deleting/renaming published fields.
  • New fields need to provide default semantics to ensure old consumers can ignore them.
  • When destructive changes are needed, should be distinguished byindex.json.version(or introducing explicitschema_version) and provide migration strategy.

Appendix A: JSON Minimum Example

A.1 index.json

{ "version": "1.0.0", "releases": [ { "release_version": "8.0.RC1", "release_date": "2024-09-30" }, { "release_version": "8.0.0", "release_date": "2024-12-30" } ] }

A.2 registry/ /metadata.json

{ "release_version": "8.0.RC1", "branch_name": "master" }

A.3 registry/ /operators.json

{ "operators": [ { "op_type": "Foo", "inputs": [ { "name": "x", "type": "INPUT", "dtype": "TensorType({DT_FLOAT})" }, { "name": "xo1", "type": "OPTIONAL_INPUT", "dtype": "TensorType({DT_FLOAT})" } ], "outputs": [ { "name": "y", "type": "OUTPUT", "dtype": "TensorType({DT_FLOAT})" } ], "attrs": [ { "name": "a", "type": "Int", "required": false, "default_value": "0" }, { "name": "flag", "type": "Bool", "required": true } ], "subgraphs": [] } ] }

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/9/10 22:32:31

论文初稿与实习并行,按碎片时间推进的节奏

白天在岗实习&#xff0c;论文初稿只能挤通勤、午休和下班后的零散时间——拖慢进度的往往不是时间太短&#xff0c;而是每次坐下都要先花十几分钟回忆"上次写到哪"。知学术AIPaperGPT 用免费智能大纲起步&#xff0c;AI 无限改稿能力与 1 小时全文承接这套"接续…

作者头像 李华
网站建设 2026/9/10 22:32:25

Multisim 14.3 安装与汉化指南(附下载链接)

Multisim 14.3 安装与汉化指南&#xff08;附下载&#xff09; 安装包获取 夸克网盘&#xff1a; 我用夸克网盘给你分享了「Multisim 14.3安装2026」&#xff0c;点击链接或复制整段内容&#xff0c;打开「夸克APP」即可获取。 链接&#xff1a;https://pan.quark.cn/s/786fcd…

作者头像 李华
网站建设 2026/9/10 22:30:35

大学院笔试练习:线性代数与数据结构备考全解析

说实话&#xff0c;看到“大学院-筆記試験練習”这个标题的时候&#xff0c;我脑子里第一时间浮起来的画面&#xff0c;就是当年备考时图书馆桌子上一摞草稿纸、一支笔、一杯咖啡的日子。“大学院”这个词&#xff0c;熟悉日本留学方向的同学应该都知道&#xff0c;指的是研究生…

作者头像 李华
网站建设 2026/9/10 22:29:13

MCP与A2A协议:AI系统架构的标准化革命

1. AI系统架构的范式转变&#xff1a;MCP与A2A协议诞生背景2018年Transformer架构问世以来&#xff0c;大模型技术经历了从单任务微调到多模态理解的跨越式发展。但在实际产业落地过程中&#xff0c;开发者们逐渐意识到一个根本性矛盾&#xff1a;模型能力的指数级增长与工程化…

作者头像 李华