Function: init_dump
Applicable Products
- Ascend 950PR&950DT products: Supported
- Atlas A3 products: Supported
- Atlas A2 products: Supported
- Atlas 200I/500 A2 inference products: Supported
- Atlas inference products: Supported
- Atlas training products: Supported
Function
Initializes dump.
Prototype
-
C Prototype
aclError aclmdlInitDump() -
Python Function
ret = acl.mdl.init_dump()
Parameters
None
Return Values
| Return Value | Description |
|---|---|
| ret | Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails. |
Constraints
-
acl.mdl.init_dump must be used in pair with acl.mdl.set_dump and acl.mdl.finalize_dump to dump data to files. These APIs can be called for multiple times in a single process to obtain dump data of different Dump configurations.
-
Example scenario:
- To execute the model twice, you need to set different dump configurations. The API call sequence is as follows: acl.init --> acl.mdl.init_dump --> acl.mdl.set_dump --> Model Loading --> Model Execution --> acl.mdl.finalize_dump --> Model Unloading --> acl.mdl.init_dump --> acl.mdl.set_dump --> Model Loading --> Model Execution --> acl.mdl.finalize_dump --> Model Unloading --> Other tasks --> acl.finalize
- If a model is executed twice, dump is required for the first execution and not required for the second execution. The API call sequence is as follows: acl.init --> acl.mdl.init_dump --> acl.mdl.set_dump --> Model Loading --> Model Execution --> acl.mdl.finalize_dump --> Model unloading --> Model loading --> Model Execution --> Other tasks --> acl.finalize
-
When setting model dump, single-operator dump, and overflow operator dump, if you have called acl.init to set the dump, a failure message is returned when acl.mdl.init_dump is called.
-
acl.mdl.init_dump must be called after acl.init and before the model loading API.
Reference
acl.init is also available. During initialization, the dump configuration is passed through a JSON file to dump the data at runtime. In this mode, acl.init can be called only once in a process. You can modify the dump configuration in the JSON file.