W3cubDocs

/PyTorch 2.9

Threading Environment Variables

Created On: Jun 10, 2025 | Last Updated On: Jun 10, 2025

Variable

Description

OMP_NUM_THREADS

Sets the maximum number of threads to use for OpenMP parallel regions.

MKL_NUM_THREADS

Sets the maximum number of threads to use for the Intel MKL library. Note that MKL_NUM_THREADS takes precedence over OMP_NUM_THREADS.

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/threading_environment_variables.html