Function: binary_load_from_file

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

Description

Loads and parses the operator binary file from a file and outputs the binHandle that points to the operator binary file.

For AI Core operators, if this API is used to load and parse the operator binary file, the acl.rt.launch_kernel_with_config API must be used to deliver the compute task.

Prototype

  • C Prototype
    1
    aclError aclrtBinaryLoadFromFile(const char* binPath, aclrtBinaryLoadOptions *options, aclrtBinHandle *binHandle)
    
  • Python Function
    1
    bin_handle, ret = acl.rt.binary_load_from_file(bin_path, options)
    

Parameters

Parameter

Description

bin_path

Str, path of the operator binary file (.o file). The path must be an absolute path. For AI CPU operators, this parameter can be set to an operator library file (.json).

options

List, optional parameter for loading the operator binary file. For details about the structure, see aclrtBinaryLoadOptions . If the parameter is empty, set options to [].

Return Value

Return Value

Description

bin_handle

Int, handle of the operator binary file.

ret

Int, 0 on success; else, failure.

Restrictions

The operator binary file generated during the compilation of a product model must be used on the product of the same model.