Function: set_model_dir

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Function Usage

Sets the directory for loading model files. The directory stores single-operator model files (*.om files).

Prototype

  • C Prototype
    1
    aclError aclopSetModelDir(const char *modelDir)
    
  • Python Function
    1
    ret = acl.op.set_model_dir(model_dir)
    

Parameters

Parameter

Description

model_dir

Str, directory where the specified model file is stored.

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

For the 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

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Restrictions

Before loading a model file, check whether the memory is sufficient based on the file size. If the memory is insufficient, the application will malfunction.

For the Atlas 200I/500 A2 inference product , when your app runs on the host, a single process can execute up to 40,000,000 operators at a time.

For the Atlas training product , when your app runs on the host, a single process can execute up to 40,000,000 operators at a time.

For the Atlas A2 training product / Atlas A2 inference product , when your app runs on the host, a single process can execute up to 2,000,000 operators at a time.

For the Atlas inference product , when your app runs on the host, a single process can execute up to 40,000,000 operators at a time. When your app runs on the device, a single process can execute up to 2,000,000 operators at a time.

For the Atlas A3 training product / Atlas A3 inference product , when your app runs on the host, a single process can execute up to 2,000,000 operators at a time.

Reference

For details about the API call sequence and example, see Single-Operator Execution.