尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

CANN/ge ES生成器工具指南

CANN/ge ES生成器工具指南
📅 发布时间:2026/7/4 10:04:38

ES (Eager Style) Generator

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

Prerequisites

  1. Properly installtoolkitpackage through Installation Guide, andcorrectly configure environment variablesaccording to the guide
  2. Properly install operatoropspackage through Installation Guide (ES depends on operator prototypes for API generation), andcorrectly configure environment variablesaccording to the guide

Environment Variable Requirements

List of environment variables required by gen_esb:

  • ASCEND_OPP_PATH: Points to the opp path under installation directory
  • LD_LIBRARY_PATH: Environment variable specifying dynamic library search path

Note: The above environment variables don't need and are not recommended to be configured separately, the environment variables already configured in Prerequisites by default meet the requirements

Functionality Explanation

This program supports two generation modes

  1. Code Generation Mode Generate ES graph builder C, C++, Python code, including:
  • C interfaces for all supported operators (ops)
  • C++ interfaces for all supported operators
  • Python interfaces for all supported operators
  • Aggregation header files for convenient one-time inclusion of all operators
  • Aggregation Python files for convenient one-time import of all operators
  1. Historical Prototype Library Generation Mode Generate historical prototype structured data, including:
  • Version index
  • Version metadata
  • Operator prototype data for that version

Usage Methods

Code Generation Mode

gen_esb [--output_dir=DIR] [--module_name=NAME] [--h_guard_prefix=PREFIX] [--exclude_ops=OP_TYPE1,OP_TYPE2] [--history_registry=PKG_DIR] [--release_version=VER]

Historical Prototype Library Generation Mode

gen_esb --es_mode=extract_history --release_version=VER [--output_dir=DIR] [--release_date=YYYY-MM-DD] [--branch_name=BRANCH]

Note: Because environment variables have already been configured in Prerequisites,gen_esbhas been added toPATHenvironment variable, so can be executed directly

Parameter Explanation

  • --es_mode: Optional parameter, specify generation mode, supportscodegenandextract_historyIf not specified, defaults to codegen
  • --output_dir: Optional parameter, specify target directory for generation If not specified, defaults to output to current directory
  • --module_name: Optional parameter, control aggregation header file naming
    • "math" -> es_math_ops_c.h, es_math_ops.h, es_math_ops.py
    • "all" -> es_all_ops_c.h, es_all_ops.h, es_all_ops.py
    • Not passed -> defaults to "all"
  • --h_guard_prefix: Optional parameter, control generated header file guard macro prefix, used for possible internal/external operator same-name situation distinction
    • If not specified, use default prefix
    • When specified, concatenate with default prefix
    • python files don't recognize this parameter, same-name scenarios avoid conflict through different paths
  • --exclude_ops: Optional parameter, control operators to exclude from code generation
    • Separate operator names by,
  • --history_registry: Optional parameter, specify historical prototype library directory for code generation
    • If not specified, historical prototype library is not enabled by default
    • When specified, generated C++ interface will include compatible version information in historical prototype library
  • --release_version:
    • Code generation mode: Optional parameter, used with--history_registry, specify current version number, generated C++ interface includes compatible version information for this version; if not specified, generate compatible historical versions based on current date
    • Historical prototype library generation mode: Required parameter, specify version number corresponding to current historical prototype data
  • --release_date: Optional parameter, control release date of historical prototype structured data, formatYYYY-MM-DD
    • If not specified, use current date
  • --branch_name: Optional parameter, control release branch name of historical prototype structured data

Output File Explanation

Code Generation Mode Output
  • es_ _ops_c.h: C interface aggregation header file
  • es_ _ops.h: C++ interface aggregation header file
  • es_ _ops.py: Python interface aggregation file
  • es_<op_type>_c.h: Single operator C interface header file
  • es_<op_type>.cpp: Single operator C interface implementation file
  • es_<op_type>.h: Single operator C++ interface header file
  • es_<op_type>.py: Single operator Python interface file
Historical Prototype Library Generation Mode Output
  • index.json: Version index
  • registry/ /metadata.json: Version metadata
  • registry/ /operators.json: Operator prototype data for that version

Usage Examples

Generate code to current directory, use default module name "all", default guard macro prefix

gen_esb

Generate code to specified directory, use default module name "all", default guard macro prefix

gen_esb --output_dir=./output

Generate code to specified directory, use "math" module name, default guard macro prefix

gen_esb --output_dir=./output --module_name=math

Generate code to specified directory, use "all" module name, default guard macro prefix

gen_esb --output_dir=./output --module_name=all

Generate code to specified directory, use "math" module name, custom guard macro prefix "MY_CUSTOM"

gen_esb --output_dir=./output --module_name=math --h_guard_prefix=MY_CUSTOM

Generate code to specified directory, use "math" module name, custom guard macro prefix "MY_CUSTOM", and exclude Add operator generation

gen_esb --output_dir=./output --module_name=math --h_guard_prefix=MY_CUSTOM --exclude_ops=Add

Generate code to specified directory, use "math" module name, default guard macro prefix, generated C++ interface will include compatible version information filtered based on current date in math historical prototype directory

./gen_esb --output_dir=./output --module_name=math --history_registry=/${CANN_INSTALL_PATH}/cann/opp/history_registry/math

Generate code to specified directory, use "math" module name, default guard macro prefix, generated C++ interface will include historical version information compatible with "8.0.RC2" version in math historical prototype directory

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

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

相关新闻

  • 高性能计算之OpenMP——超算习堂学习2
  • PoseDiffusion部署实战:从本地测试到生产环境的完整指南
  • gprMax项目代码分解:理解 gprMax的项目结构、运行主线与开发模块

最新新闻

  • YOLOv12密集行人检测系统开发实战
  • 机器学习管线:从实验到生产的工程化实践指南
  • 遗传编程实战:用进化算法自动生成可部署工业代码
  • 大模型微调中的风险管理与参数优化实践
  • Gemini国内镜像站实测选型指南:API响应头、上下文截断与多模态水分检测
  • 脉冲神经网络时序编码与多时相波计算原理

日新闻

  • STM32F745VG与MC6470 IMU的高性能姿态控制系统设计
  • 机器不消费,人何以生存
  • AI项目操作手册编写规范与最佳实践

周新闻

  • Windows字体自定义终极方案:No!! MeiryoUI完全指南
  • Deepin Boot Maker:告别命令行,3分钟制作Linux启动盘的智能解决方案
  • Plain Craft Launcher 2:重新定义你的Minecraft游戏体验

月新闻

  • 2026年6月公司网站搭建最新热门渠道测评:四大低成本/零代码平台对比+避坑
  • 【Linux】Linux arm 编译QT程序,出现expected “}“报错
  • 【MATLAB例程】四基站二维AOA定位与距离辅助增强对比仿真。基于角度观测和测距修正的固定目标平面定位精度分析

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号