GeSessionLoadGraph

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

x

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <ge/ge_api.h>
  • Library file: libge_runner.so

Function Usage

Applies only to the scenario where the graph is executed asynchronously. The specified session is used to bind the graph with the specified value of graph ID to the corresponding stream.

After the GeSessionLoadGraph API is successfully executed, you can use the GeSessionExecuteGraphWithStreamAsync API to execute the graph.

Prototype

1
ge::Status GeSessionLoadGraph(ge::Session &session, uint32_t graph_id, const std::map<ge::AscendString, ge::AscendString> &options, void *stream)

Parameters

Parameter

Input/Output

Description

session

Input

Session instance of the graph to be loaded.

graph_id

Input

ID of the graph to be executed.

options

Input

Options that may be used in the execution phase. A key-value mapping table, for the graph configuration. key indicates the option type, and value indicates the option value.

Generally, this parameter can be left blank, indicating using the same options configuration passed to GEInitialize.

The key and value are of the AscendString type. You can use this parameter to configure the current graph separately. For details about the supported configuration options, see Options > ge.exec.frozenInputIndexes. Currently, only this parameter can be configured.

stream

Input

Graph execution flow.

Returns

Parameter

Type

Description

-

Status

GE_CLI_SESS_RUN_FAILED: Serialization failed when a subgraph is executed.

SUCCESS: Subgraph executed successfully.

FAILED: Failed to execute the subgraph.

Restrictions

Before calling this API, ensure that the CompileGraph process has been completed and the API must be used together with GeSessionExecuteGraphWithStreamAsync.