{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Memory management utils" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Utility functions for memory management. Currently primarily for GPU." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "from fastai.gen_doc.nbdoc import *\n", "from fastai.utils.mem import * " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [ { "data": { "text/markdown": [ "
gpu_mem_get[source][test]gpu_mem_get(**`id`**=***`None`***)\n",
"\n",
"gpu_mem_get_all[source][test]gpu_mem_get_all()\n",
"\n",
"gpu_mem_get_free[source][test]gpu_mem_get_free()\n",
"\n",
"No tests found for gpu_mem_get_free. To contribute a test please refer to this guide and this discussion.
gpu_mem_get_free_no_cache[source][test]gpu_mem_get_free_no_cache()\n",
"\n",
"No tests found for gpu_mem_get_free_no_cache. To contribute a test please refer to this guide and this discussion.
gpu_mem_get_used[source][test]gpu_mem_get_used()\n",
"\n",
"gpu_mem_get_used_no_cache[source][test]gpu_mem_get_used_no_cache()\n",
"\n",
"No tests found for gpu_mem_get_used_no_cache. To contribute a test please refer to this guide and this discussion.
gpu_mem_get_used_fast[source][test]gpu_mem_get_used_fast(**`gpu_handle`**)\n",
"\n",
"No tests found for gpu_mem_get_used_fast. To contribute a test please refer to this guide and this discussion.
gpu_with_max_free_mem[source][test]gpu_with_max_free_mem()\n",
"\n",
"preload_pytorch[source][test]preload_pytorch()\n",
"\n",
"No tests found for preload_pytorch. To contribute a test please refer to this guide and this discussion.
class GPUMemory[test]GPUMemory(**`total`**, **`free`**, **`used`**) :: `tuple`\n",
"\n",
"No tests found for GPUMemory. To contribute a test please refer to this guide and this discussion.
b2mb[source][test]b2mb(**`num`**)\n",
"\n",
"No tests found for b2mb. To contribute a test please refer to this guide and this discussion.
class GPUMemTrace[source][test]GPUMemTrace(**`silent`**=***`False`***, **`ctx`**=***`None`***, **`on_exit_report`**=***`True`***)\n",
"\n",
"gpu_mem_trace[source][test]gpu_mem_trace(**`func`**)\n",
"\n",
"report[source][test]report(**`subctx`**=***`None`***)\n",
"\n",
"silent[source][test]silent(**`silent`**=***`True`***)\n",
"\n",
"No tests found for silent. To contribute a test please refer to this guide and this discussion.
start[source][test]start()\n",
"\n",
"reset[source][test]reset()\n",
"\n",
"peak_monitor_stop[source][test]peak_monitor_stop()\n",
"\n",
"No tests found for peak_monitor_stop. To contribute a test please refer to this guide and this discussion.
stop[source][test]stop()\n",
"\n",
"report_n_reset[source][test]report_n_reset(**`subctx`**=***`None`***)\n",
"\n",
"No tests found for report_n_reset. To contribute a test please refer to this guide and this discussion.
peak_monitor_func[source][test]peak_monitor_func()\n",
"\n",
"No tests found for peak_monitor_func. To contribute a test please refer to this guide and this discussion.
data_set[source][test]data_set()\n",
"\n",
"No tests found for data_set. To contribute a test please refer to this guide and this discussion.
data[source][test]data()\n",
"\n",
"No tests found for data. To contribute a test please refer to this guide and this discussion.
peak_monitor_start[source][test]peak_monitor_start()\n",
"\n",
"No tests found for peak_monitor_start. To contribute a test please refer to this guide and this discussion.