Package org.nd4j.common.config
Class ND4JEnvironmentVars
- java.lang.Object
-
- org.nd4j.common.config.ND4JEnvironmentVars
-
public class ND4JEnvironmentVars extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringBACKEND_DYNAMIC_LOAD_CLASSPATHApplicability: always - but only if an ND4J backend cannot be found/loaded via standard ServiceLoader mechanisms
Description: Set this environment variable to a set fully qualified JAR files to attempt to load before failing on not loading a backend.static StringBACKEND_PRIORITY_AURORAApplicability: nd4j-aurora-xx, when multiple backends are on classpath
Description: Defines the priority that the CUDA (GPU) backend should be loaded (or attempt to be loaded).static StringBACKEND_PRIORITY_CPUApplicability: nd4j-native, when multiple backends are on classpath
Description: Defines the priority that the CPU/Native backend should be loaded (or attempt to be loaded).static StringBACKEND_PRIORITY_GPUApplicability: nd4j-cuda-xx, when multiple backends are on classpath
Description: Defines the priority that the CUDA (GPU) backend should be loaded (or attempt to be loaded).static StringDL4J_VOID_IPApplicability: nd4j-parameter-server
Usage: A fallback for determining the local IP the parameter server, if other approaches fail to determine the local IPstatic StringND4J_CUDA_FORCE_SINGLE_GPUApplicability: nd4j-cuda-xx used on multi-GPU systems
Description: If set, only a single GPU will be used by ND4J, even if multiple GPUs are available in the systemstatic StringND4J_CUDA_MAX_BLOCK_SIZEApplicability: nd4j-cuda-xx
Description:static StringND4J_CUDA_MAX_CONTEXTSApplicability: nd4j-cuda-xx
Description: This variable defines how many concurrent threads will be able to use same device.static StringND4J_CUDA_MAX_DEVICE_ALLOCATIONApplicability: nd4j-cuda-xx
Description:static StringND4J_CUDA_MAX_DEVICE_CACHEApplicability: nd4j-cuda-xx
Description:static StringND4J_CUDA_MAX_GRID_SIZEApplicability: nd4j-cuda-xx
Description:static StringND4J_CUDA_MAX_HOST_CACHEApplicability: nd4j-cuda-xx
Description:static StringND4J_CUDA_MIN_BLOCK_SIZEApplicability: nd4j-cuda-xx
Description:static StringND4J_CUDA_USE_PREALLOCATIONApplicability: nd4j-cuda-xx
Description:static StringND4J_FALLBACKApplicability: nd4j-native backend
Description: Whether build-in BLAS matrix multiplication (GEMM) should be used instead of the native BLAS library such as MKL or OpenBLAS.static StringND4J_IGNORE_AVXApplicability: nd4j-native
Description: Set to true to avoid logging AVX warnings (i.e., running generic x86 binaries on an AVX2 system)static StringND4J_MKL_FALLBACKApplicability: nd4j-nativestatic StringND4J_RESOURCES_CACHE_DIRstatic StringND4J_SKIP_BLAS_THREADSApplicability: nd4j-native backend
Description: Skips the setting of theOMP_NUM_THREADSproperty for ND4J ops.static StringOMP_NUM_THREADSApplicability: nd4j-native backend
Description: Sets the number of OpenMP parallel threads for ND4J native operations (and also native BLAS libraries such as Intel MKL and OpenBLAS).static StringSD_FORBID_HELPERSIf set, this variable disables use of optimized platform helpers (i.e.static StringSD_MASTER_THREADSThis variable defines how many threads will be used for any 1 linear algebra operation.static StringSD_MAX_DEVICE_BYTESIf set, this variable defines how much memory application is allowed to use on any one computational devicestatic StringSD_MAX_PRIMARY_BYTESIf set, this variables defines how much memory application is allowed to use off-heap.static StringSD_MAX_SPECIAL_BYTESIf set, this variable defines how much memory application is allowed to use ON ALL computational devices COMBINED.static StringSD_MAX_THREADSThis variable defines how many threads will be used in ThreadPool for parallel execution of linear algebra.
-
-
-
Field Detail
-
BACKEND_PRIORITY_CPU
public static final String BACKEND_PRIORITY_CPU
Applicability: nd4j-native, when multiple backends are on classpath
Description: Defines the priority that the CPU/Native backend should be loaded (or attempt to be loaded). If this is set to a higher value thanBACKEND_PRIORITY_GPU(which has default value 100) the native backend will be loaded in preference to the CUDA backend, when both are on the classpath. Default value: 0- See Also:
- Constant Field Values
-
BACKEND_PRIORITY_GPU
public static final String BACKEND_PRIORITY_GPU
Applicability: nd4j-cuda-xx, when multiple backends are on classpath
Description: Defines the priority that the CUDA (GPU) backend should be loaded (or attempt to be loaded). If this is set to a higher value thanBACKEND_PRIORITY_CPU(which has default value 0) the GPU backend will be loaded in preference to the CUDA backend, when both are on the classpath. Default value: 100 - hence by default, the CUDA backend will be loaded when both it and the CPU/native backend are on the classpath- See Also:
- Constant Field Values
-
BACKEND_PRIORITY_AURORA
public static final String BACKEND_PRIORITY_AURORA
Applicability: nd4j-aurora-xx, when multiple backends are on classpath
Description: Defines the priority that the CUDA (GPU) backend should be loaded (or attempt to be loaded). If this is set to a higher value thanBACKEND_PRIORITY_CPU(which has default value 0) the Aurora backend will be loaded in preference to the AURORA backend, when both are on the classpath. Default value: 100 - hence by default, the AURORA backend will be loaded when both it and the CPU/native backend are on the classpath- See Also:
- Constant Field Values
-
BACKEND_DYNAMIC_LOAD_CLASSPATH
public static final String BACKEND_DYNAMIC_LOAD_CLASSPATH
Applicability: always - but only if an ND4J backend cannot be found/loaded via standard ServiceLoader mechanisms
Description: Set this environment variable to a set fully qualified JAR files to attempt to load before failing on not loading a backend. JAR files should be semi-colon delimited; i.e., "/some/file.jar;/other/path.jar". This should rarely be required in practice - for example, only in dynamic class loading/dynamic classpath scenarios
For equivalent system property, seeND4JSystemProperties.DYNAMIC_LOAD_CLASSPATH_PROPERTYfor the equivalent system property (that will take precidence if both are set)- See Also:
- Constant Field Values
-
OMP_NUM_THREADS
public static final String OMP_NUM_THREADS
Applicability: nd4j-native backend
Description: Sets the number of OpenMP parallel threads for ND4J native operations (and also native BLAS libraries such as Intel MKL and OpenBLAS). By default, this will be set to the number of physical cores (i.e., excluding hyperthreading cores), which usually provides optimal performance. Setting this to a larger value than the number of physical cores (for example, equal to number of logical cores - i.e., setting to 16 on an 8-core + hypethreading processor) - can result in reduced performance
Note that if you have a significant number of parallel Java threads (for example, Spark or ParallelWrapper), or you want to keep some cores free for other programs - you may want to reduce this value.- See Also:
ND4J_SKIP_BLAS_THREADS, Constant Field Values
-
ND4J_SKIP_BLAS_THREADS
public static final String ND4J_SKIP_BLAS_THREADS
Applicability: nd4j-native backend
Description: Skips the setting of theOMP_NUM_THREADSproperty for ND4J ops. Note that this property will usually still take effect for native BLAS libraries (MKL, OpenBLAS) even if this property is set- See Also:
- Constant Field Values
-
ND4J_FALLBACK
public static final String ND4J_FALLBACK
Applicability: nd4j-native backend
Description: Whether build-in BLAS matrix multiplication (GEMM) should be used instead of the native BLAS library such as MKL or OpenBLAS. This can have a noticable performance impact for these ops. Note that this is typically only useful as a workaround (or test) for bugs in these underlying native libraries, which are rare (but do occasionally occur on some platforms)- See Also:
- Constant Field Values
-
DL4J_VOID_IP
public static final String DL4J_VOID_IP
Applicability: nd4j-parameter-server
Usage: A fallback for determining the local IP the parameter server, if other approaches fail to determine the local IP- See Also:
- Constant Field Values
-
ND4J_CUDA_MAX_BLOCK_SIZE
public static final String ND4J_CUDA_MAX_BLOCK_SIZE
Applicability: nd4j-cuda-xx
Description:- See Also:
- Constant Field Values
-
ND4J_CUDA_MIN_BLOCK_SIZE
public static final String ND4J_CUDA_MIN_BLOCK_SIZE
Applicability: nd4j-cuda-xx
Description:- See Also:
- Constant Field Values
-
ND4J_CUDA_MAX_GRID_SIZE
public static final String ND4J_CUDA_MAX_GRID_SIZE
Applicability: nd4j-cuda-xx
Description:- See Also:
- Constant Field Values
-
ND4J_CUDA_MAX_CONTEXTS
public static final String ND4J_CUDA_MAX_CONTEXTS
Applicability: nd4j-cuda-xx
Description: This variable defines how many concurrent threads will be able to use same device. Keep in mind, this doesn't affect natural CUDA limitations- See Also:
- Constant Field Values
-
ND4J_CUDA_FORCE_SINGLE_GPU
public static final String ND4J_CUDA_FORCE_SINGLE_GPU
Applicability: nd4j-cuda-xx used on multi-GPU systems
Description: If set, only a single GPU will be used by ND4J, even if multiple GPUs are available in the system- See Also:
- Constant Field Values
-
ND4J_CUDA_USE_PREALLOCATION
public static final String ND4J_CUDA_USE_PREALLOCATION
Applicability: nd4j-cuda-xx
Description:- See Also:
- Constant Field Values
-
ND4J_CUDA_MAX_DEVICE_CACHE
public static final String ND4J_CUDA_MAX_DEVICE_CACHE
Applicability: nd4j-cuda-xx
Description:- See Also:
- Constant Field Values
-
ND4J_CUDA_MAX_HOST_CACHE
public static final String ND4J_CUDA_MAX_HOST_CACHE
Applicability: nd4j-cuda-xx
Description:- See Also:
- Constant Field Values
-
ND4J_CUDA_MAX_DEVICE_ALLOCATION
public static final String ND4J_CUDA_MAX_DEVICE_ALLOCATION
Applicability: nd4j-cuda-xx
Description:- See Also:
- Constant Field Values
-
ND4J_MKL_FALLBACK
public static final String ND4J_MKL_FALLBACK
Applicability: nd4j-native- See Also:
- Constant Field Values
-
ND4J_RESOURCES_CACHE_DIR
public static final String ND4J_RESOURCES_CACHE_DIR
- See Also:
- Constant Field Values
-
ND4J_IGNORE_AVX
public static final String ND4J_IGNORE_AVX
Applicability: nd4j-native
Description: Set to true to avoid logging AVX warnings (i.e., running generic x86 binaries on an AVX2 system)- See Also:
- Constant Field Values
-
SD_MAX_THREADS
public static final String SD_MAX_THREADS
This variable defines how many threads will be used in ThreadPool for parallel execution of linear algebra. Default value: number of threads supported by this system.- See Also:
- Constant Field Values
-
SD_MASTER_THREADS
public static final String SD_MASTER_THREADS
This variable defines how many threads will be used for any 1 linear algebra operation. Default value: number of threads supported by this system.- See Also:
- Constant Field Values
-
SD_FORBID_HELPERS
public static final String SD_FORBID_HELPERS
If set, this variable disables use of optimized platform helpers (i.e. mkldnn or cuDNN)- See Also:
- Constant Field Values
-
SD_MAX_PRIMARY_BYTES
public static final String SD_MAX_PRIMARY_BYTES
If set, this variables defines how much memory application is allowed to use off-heap. PLEASE NOTE: this option is separate from JVM XMS/XMX options- See Also:
- Constant Field Values
-
SD_MAX_SPECIAL_BYTES
public static final String SD_MAX_SPECIAL_BYTES
If set, this variable defines how much memory application is allowed to use ON ALL computational devices COMBINED.- See Also:
- Constant Field Values
-
SD_MAX_DEVICE_BYTES
public static final String SD_MAX_DEVICE_BYTES
If set, this variable defines how much memory application is allowed to use on any one computational device- See Also:
- Constant Field Values
-
-