aclopSetModelDir

Description

Sets the directory of the model file, which is an .om file compiled from a single-operator.

Restrictions

  • The version of the operator library in the model file loading environment must be the same as that of the model file compilation environment. Otherwise, an error is reported during operator loading.

    This constraint applies to the following scenarios:

    • Dynamic-shape operator scenario
    • Ascend virtual instance scenario

    You can view the version field in the ${INSTALL_DIR} /opp/version.info file to view the operator library version.

    Replace ${INSTALL_DIR} with the actual CANN component directory. If the Ascend-CANN-Toolkit package is installed as the root user, the CANN component directory is /usr/local/Ascend/ascend-toolkit/latest.

  • Before loading, check whether the memory space is sufficient based on the size of the single-operator .om file. If the memory space is insufficient, the app will be abnormal.

    Model

    Maximum Number of Operators That Are Being Executed in a Process

    Atlas 200/300/500 Inference Product

    In Ascend EP mode, the upper limit is 40000000.

    2 million in Ascend RC form

    Atlas Training Series Product

    40000000

Prototype

aclError aclopSetModelDir(const char *modelDir)

Parameters

Parameter

Input/Output

Description

modelDir

Input

Pointer to the model file directory.

A multi-level directory is supported. However, the system reads the model up to three levels down from the last level.

For example, if modelDir is set to dir0/dir1 and dir1 contains dir2/dir3/dir4, the system looks up for the model file in dir1, dir1/dir2 and dir1/dir2/dir3 only.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.

See Also