From 399fcd1eb90a1c81ebb5555ef9333dd8577f96e6 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Fri, 15 May 2020 15:32:59 +0800 Subject: [PATCH] update doc of memory optimize (#2111) * update doc of memory optimize * follow comments, test=develop --- .../singlenode_training_improving/memory_optimize.rst | 1 + .../singlenode_training_improving/memory_optimize_en.rst | 3 +++ 2 files changed, 4 insertions(+) diff --git a/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize.rst b/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize.rst index 37dbbd01f..ae9238813 100644 --- a/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize.rst +++ b/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize.rst @@ -69,6 +69,7 @@ export FLAGS_allocator_strategy=naive_best_fit # 选择显存预分配策略 +此外,自1.7.2+版本起,PaddlePaddle提供了环境变量 :code:`FLAGS_gpu_memory_limit_mb` ,用于控制单个任务进程可分配的最大显存,单位是MB。默认值是0,表示没有限制,可分配全部显存。如果设置为大于0的值,则会在分配的显存超过限制时报错,即使此时系统还存在空闲的显存空间。 2. PaddlePaddle的存储优化策略 =========================== diff --git a/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize_en.rst b/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize_en.rst index ab56d57da..2a1e3ecb0 100644 --- a/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize_en.rst +++ b/doc/fluid/advanced_guide/performance_improving/singlenode_training_improving/memory_optimize_en.rst @@ -77,6 +77,9 @@ Use Pre-Allocation strategy: export FLAGS_allocator_strategy=naive_best_fit # Use Pre-Allocation strategy +Plus, since version 1.7.2+, PaddlePaddle provides an environment variable :code:`FLAGS_gpu_memory_limit_mb`, which controls the maximum gpu memory limit that the process can allocate. +If it is equal to 0, there would be no limit and all gpu memory would be available to the process. If it is larger than 0, the process would raise out of memory error if the allocated +memory exceeds the limit even though there is available memory on the gpu card. The unit is MB and default value is 0. 2. Memory Optimization Strategy =========================== -- GitLab