Run

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <ge/fusion/pass/pattern_fusion_pass.h>
  • Library file: libge_compiler.so

Function Usage

Main function for pass execution.

The function obtains the pattern graph constructed by PatternGraphs and uses it to build a pattern.

It then performs one-by-one matching within the target graph and invokes the Requires function to determine whether each match result is eligible for replacement. If a match result meets the replacement criteria (the value true is returned), the function further proceeds with the replacement. It calls Replacement to obtain the target structure and replaces the subgraph corresponding to the match result with the replacement subgraph.

Note: The Run function can be used to process only the current graph. If a subgraph needs to be processed, the pass caller is responsible for processing the subgraph.

Prototype

1
Status Run(GraphPtr &graph, CustomPassContext &pass_context) override

Parameters

Parameter

Input/Output

Description

graph

Input

Target graph.

pass_context

Input

Context, which can be used to transfer information such as error messages.

Returns

Parameter

Type

Description

-

Status

SUCCESS: Execution succeeded.

FAILED: Execution failed.

Restrictions

None