news 2026/9/10 20:41:01

CANN/ge GE工具模块文档

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN/ge GE工具模块文档

GeUtils

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

Product Support Status

ProductSupport Status
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products

Module Import

from ge.utils import GeUtils

Functionality Description

GeUtilsprovides GE (Graph Engine) common utility interfaces, including Shape derivation and AICore operator support checking functionality.

  • infer_shape: Performs Shape derivation on computation graph. This interface only executes Shape derivation, does not perform other graph optimizations (such as constant folding, dead edge elimination etc.).
  • check_node_support_on_aicore: Checks if node is supported on AICore, returns boolean value for support status and unsupported reason string.

Classes

GeUtils

GeUtilsclass only contains static methods, can be used without instantiation.

Static MethodDescription
infer_shapePerforms Shape derivation on computation graph
check_node_support_on_aicoreChecks if node is supported on AICore

Function Prototypes

infer_shape

@staticmethod def infer_shape(graph: Graph, input_shapes: List[List[int]]) -> None

Performs Shape derivation on computation graph. Only executes Shape derivation, does not perform constant folding, dead edge elimination and other graph optimizations.

check_node_support_on_aicore

@staticmethod def check_node_support_on_aicore(node: Node) -> Tuple[bool, str]

Checks if node is supported on AICore, returns boolean value for support status and unsupported reason.

Parameter Description

infer_shape

ParameterTypeRequiredDescription
graphGraphYesComputation graph object to perform Shape derivation
input_shapesList[List[int]]YesInput shape list. Each element in list describes shape of a graph input, each shape is integer dimension list

check_node_support_on_aicore

ParameterTypeRequiredDescription
nodeNodeYesComputation graph node object to be checked

Return Value Description

infer_shape

No return value. Shape derivation result is directly updated in graph object.

check_node_support_on_aicore

Return ValueTypeDescription
is_supportedboolWhether node is supported on AICore. True means supported, False means not supported
unsupported_reasonstrDescription of unsupported reason. If node is supported, returns empty string

Constraint Description

  • infer_shapeonly executes Shape derivation, does not perform constant folding, dead edge elimination and other graph optimization operations.
  • input_shapesforinfer_shapemust be list of lists, each sublist elements must be integer type.
  • check_node_support_on_aicorerequires passing validNodeobject.
  • All methods inGeUtilsare static methods, can be called without creating instance.

Usage Example

from ge.utils import GeUtils from ge.graph import Graph, Node # Shape derivation graph = Graph("my_graph") # ... build graph ... GeUtils.infer_shape(graph, [[1, 3, 224, 224], [1, 3, 224, 224]]) # Check if node is supported on AICore

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

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

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

Ricon组态系统在智能楼宇中的核心应用与优化

1. Ricon组态系统与智能楼宇的完美结合 第一次接触Ricon组态系统是在三年前的一个商业综合体项目中。当时业主方提出要实现整栋大楼的智能化管控,要求将空调、照明、安防等十几个子系统集成到一个平台上。经过多方对比,我们最终选择了Ricon组态系统作为核…

作者头像 李华
网站建设 2026/9/10 20:39:09

昇腾/ge自定义逻辑流分配Pass开发

使用自定义逻辑流分配Pass定制并发 【免费下载链接】ge GE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 P…

作者头像 李华
网站建设 2026/9/10 20:31:43

2026年10款硬核降AIGC工具推荐:AIGC检测轻松拿捏

随着知网、维普、万方等主流学术平台对AIGC检测标准不断收紧,论文通过率面临严峻挑战。如何有效降低AI痕迹与查重率,成为众多学者和学生的共同难题。本文将实测对比10款主流降AI工具,助你精准选择最适合的解决方案。为什么需要降 AI 率工具&a…

作者头像 李华