--disable_reuse_memory

Applicability

Product

Supported (Yes/No)

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

Atlas inference product

Atlas training product

Description

Enables memory reuse.

Memory reuse refers to the practice of utilizing memory multiple times based on its lifecycle and size, ensuring that non-conflicting memory is reused to reduce network memory consumption.

See Also

None

Argument

  • 0 (default): Enables memory reuse.
  • 1: disabled If the network model is large, disabling memory reuse will cause the device memory not to be reused during subsequent inference, resulting in insufficient memory.

Suggestions and Benefits

None

Example

--disable_reuse_memory=0

Dependencies and Restrictions

Memory reuse is enabled by default. You can select the operators to skip memory reusing. The operator (or operators separated by commas) specified by OP_NO_REUSE_MEM will use exclusively allocated memory. For details, see Environment Variables.

  • Configuration by node name:
    After the node name is converted to be compatible with the CANN platform, ensure that the node name is correctly configured. You can obtain the node name by setting DUMP_GE_GRAPH and viewing the name field in the exported ge_onnx_xxx_Build.pbtxt.
    export OP_NO_REUSE_MEM=gradients/logits/semantic/kernel/Regularizer/l2_regularizer_grad/Mul_1,resnet_v1_50/conv1_1/BatchNorm/AssignMovingAvg2
  • Configuration by operator type:
    export OP_NO_REUSE_MEM=FusedMulAddN,BatchNorm
  • Configuration by operator name and operator type:
    export OP_NO_REUSE_MEM=FusedMulAddN,resnet_v1_50/conv1_1/BatchNorm/AssignMovingAvg