megengine.dtr.eviction_threshold

eviction_threshold = <property object>

Get or set the eviction threshold in bytes. It can also be set to a string, whose formatting supports byte(B), kilobyte(KB), megabyte(MB) and gigabyte(GB) units.

Note

When GPU memory usage exceeds this value, DTR will heuristically select and evict resident tensors until the amount of used memory falls below this threshold.

Examples

import megengine as mge
mge.dtr.eviction_threshold = "2GB"