Skip to content
Zero 0.0.5 documentation logo
Zero 0.0.5 zero.hardware.free_memory
Type to start searching
    Zero
    • zero.hardware
    Zero
    • NOTES
    • Learn
    • API REFERENCE
    • zero
    • zero.data
    • zero.hardware
    • zero.nn
    • zero.random
    • Show Source

    zero.hardware.free_memory¶

    zero.hardware.free_memory()[source]¶

    Free GPU-memory occupied by torch and run the garbage collector.

    Warning

    There is a small chunk of GPU-memory (occupied by drivers) that is impossible to free. It is a torch “limitation”, so the function inherits this property.

    Inspired by: https://github.com/xtinkt/editable/blob/1c80efb80c196cdb925fc994fc9ed576a246c7a1/lib/utils/basic.py#L124

    Return type

    None

    © Copyright 2021, Yura52.
    Created using Sphinx 3.1.2. and Material for Sphinx