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 37dbbd01fd0082260b4807dd38275191824dd840..ae9238813a614c7e3c022e06c59995e21f589c10 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 ab56d57da6c2c405f1f09cc0b206c676e3a8d855..2a1e3ecb0c52cc198c8e6c6e54f8a175222434a6 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 ===========================