MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / eviction_threshold

Function eviction_threshold

imperative/python/megengine/dtr/dtr.py:25–41  ·  view source on GitHub ↗

r"""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 tenso

(mod)

Source from the content-addressed store, hash-verified

23
24@property
25def eviction_threshold(mod):
26 r"""Get or set the eviction threshold in bytes. It can also be set to a string,
27 whose formatting supports byte(B), kilobyte(KB), megabyte(MB) and
28 gigabyte(GB) units.
29
30 Note:
31 When GPU memory usage exceeds this value, DTR will heuristically select
32 and evict resident tensors until the amount of used memory falls below
33 this threshold.
34
35 Examples:
36 .. code-block::
37
38 import megengine as mge
39 mge.dtr.eviction_threshold = "2GB"
40 """
41 return _eviction_threshold
42
43
44@eviction_threshold.setter

Callers

nothing calls this directly

Calls 1

_str2bytesFunction · 0.85

Tested by

no test coverage detected