diff --git a/doc/source/configure.rst b/doc/source/configure.rst index 794132e62..09d19c351 100644 --- a/doc/source/configure.rst +++ b/doc/source/configure.rst @@ -48,6 +48,14 @@ If using the command line, connect to the Ray cluster as follow: # Connect to ray. Notice if connected to existing cluster, you don't specify resources. ray.init(address=
) +.. note:: + Ray sets the environment variable ``OMP_NUM_THREADS=1`` by default. This is done + to avoid performance degradation with many workers (issue #6998). You can + override this by explicitly setting ``OMP_NUM_THREADS``. ``OMP_NUM_THREADS`` is commonly + used in numpy, PyTorch, and Tensorflow to perform multit-threaded linear algebra. + In multi-worker setting, we want one thread per worker instead of many threads + per worker to avoid contention. + Logging and Debugging --------------------- diff --git a/python/ray/__init__.py b/python/ray/__init__.py index 4ae597d99..165f57e70 100644 --- a/python/ray/__init__.py +++ b/python/ray/__init__.py @@ -14,9 +14,9 @@ if "pickle5" in sys.modules: "packaged along with Ray).") if "OMP_NUM_THREADS" not in os.environ: - logger.warning("[ray] Forcing OMP_NUM_THREADS=1 to avoid performance " - "degradation with many workers (issue #6998). You can " - "override this by explicitly setting OMP_NUM_THREADS.") + logger.debug("[ray] Forcing OMP_NUM_THREADS=1 to avoid performance " + "degradation with many workers (issue #6998). You can " + "override this by explicitly setting OMP_NUM_THREADS.") os.environ["OMP_NUM_THREADS"] = "1" # Add the directory containing pickle5 to the Python path so that we find the