Package org.nd4j.common.config
Class ND4JSystemProperties
- java.lang.Object
-
- org.nd4j.common.config.ND4JSystemProperties
-
public class ND4JSystemProperties extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAERON_TERM_BUFFER_PROPApplicability: nd4j-parameter-server, dl4j-spark (gradient sharing training master)
Description: Aeros in a high-performance communication library used in distributed computing contexts in some places in ND4J and DL4J.static StringCLASS_GRAPH_SCAN_RESOURCESUsed to point to a json resource that contains json for a ClassGraph ScanResult.static StringDATABUFFER_TO_STRING_MAX_ELEMENTSApplicability: always
Description: Used to specify the maximum number of elements (numbers) to print when using DataBuffer.toString().static StringDTYPEApplicability: Always
Description: Sets the default datatype for ND4J - should be one of "float", "double", "half".static StringDYNAMIC_LOAD_CLASSPATH_PROPERTYApplicability: always - but only if an ND4J backend cannot be found/loaded via standard ServiceLoader mechanisms
Description: Set this property to a set fully qualified JAR files to attempt to load before failing on not loading a backend.static StringINIT_IMPORT_REFLECTION_CACHEUsed to trigger loading the import reflection cache.static StringINIT_NATIVEOPS_HOLDERWhether to initialize the native ops holder or not.static StringJAVACPP_MEMORY_MAX_BYTESApplicability: Always
Description: This system property defines the maximum amount of off-heap memory that can be used.static StringJAVACPP_MEMORY_MAX_PHYSICAL_BYTESApplicability: Always
Description: This system property defines the maximum total amount of memory that the process can use - it is the sum of both off-heap and on-heap memory.static StringLOG_INITIALIZATIONApplicability: Always
Description: By default, ND4J will log some information when the library has completed initialization, such as the backend (CPU or CUDA), CPU/Devices, memory etc.static StringND4J_CPU_LOAD_OPENBLASApplicability: nd4j-native backend, when multiple BLAS libraries are available
Description: This system property can be used to control which BLAS library is loaded and used by ND4J.static StringND4J_CPU_LOAD_OPENBLAS_NOLAPACKApplicability: nd4j-native backend, when multiple BLAS libraries are available
Description: This system property can be used to control which BLAS library is loaded and used by ND4J.static StringND4J_IGNORE_AVXApplicability: nd4j-native when running non-AVX binary on an AVX compatible CPU
Description: Set to true to avoid logging AVX warnings (i.e., running generic x86 binaries on an AVX2 system)static StringND4J_TEMP_DIR_PROPERTYApplicability: ND4J Temporary file creation/extraction for ClassPathResource, memory mapped workspaces, and
Description: Specify the local directory where temporary files will be written.static StringNO_ARRAY_GCApplicability: always.static StringRESOURCES_CACHE_DIRApplicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources from a Strumpf resource file (Example:Resources.asFile("myFile.txt")where should the remote files be downloaded to?
This is generally used for resolving test resources, but can be used for Strumpf resource files generally.static StringRESOURCES_CONNECTION_TIMEOUTApplicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources from a Strumpf resource file (Example:Resources.asFile("myFile.txt")what should be the connection timeout, as used byFileUtils.copyURLToFile(URL, File, int, int)
Default:ResourceFile#DEFAULT_CONNECTION_TIMEOUTstatic StringRESOURCES_LOCAL_DIRSApplicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources, what local directories should be checked (in addition to the classpath) for files? This is optional.static StringRESOURCES_READ_TIMEOUTApplicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources from a Strumpf resource file (Example:Resources.asFile("myFile.txt")what should be the connection timeout, as used byFileUtils.copyURLToFile(URL, File, int, int)
Default:ResourceFile#DEFAULT_READ_TIMEOUTstatic StringSAMEDIFF_MEMORY_CACHE_DISABLEWhether caching should be enabled for samediff memory managers.static StringVERSION_CHECK_PROPERTYApplicability: Always
Description Setting the system property to false will stop ND4J from performing the version check, and logging any warnings/errors.
-
-
-
Field Detail
-
NO_ARRAY_GC
public static final String NO_ARRAY_GC
Applicability: always. Description: Nd4j has a DeallocatorService for handling automatic deallocation of ndarrays. This can cause crashes.- See Also:
- Constant Field Values
-
DTYPE
public static final String DTYPE
Applicability: Always
Description: Sets the default datatype for ND4J - should be one of "float", "double", "half". ND4J is set to float (32-bit floating point values) by default.- See Also:
- Constant Field Values
-
LOG_INITIALIZATION
public static final String LOG_INITIALIZATION
Applicability: Always
Description: By default, ND4J will log some information when the library has completed initialization, such as the backend (CPU or CUDA), CPU/Devices, memory etc. This system property can be used to disable the logging of this initialization information- See Also:
- Constant Field Values
-
ND4J_IGNORE_AVX
public static final String ND4J_IGNORE_AVX
Applicability: nd4j-native when running non-AVX binary on an AVX compatible CPU
Description: Set to true to avoid logging AVX warnings (i.e., running generic x86 binaries on an AVX2 system)- See Also:
- Constant Field Values
-
JAVACPP_MEMORY_MAX_BYTES
public static final String JAVACPP_MEMORY_MAX_BYTES
Applicability: Always
Description: This system property defines the maximum amount of off-heap memory that can be used. ND4J uses off-heap memory for storage of all INDArray data. This off-heap memory is a different pool of memory to the on-heap JVM memory (configured using standard Java Xms/Xmx options). Default: 2x Java XMX setting
-
JAVACPP_MEMORY_MAX_PHYSICAL_BYTES
public static final String JAVACPP_MEMORY_MAX_PHYSICAL_BYTES
Applicability: Always
Description: This system property defines the maximum total amount of memory that the process can use - it is the sum of both off-heap and on-heap memory. This can be used to provide an upper bound on the maximum amount of memory (of all types) that ND4J will use- See Also:
JAVACPP_MEMORY_MAX_BYTES, Constant Field Values
-
ND4J_TEMP_DIR_PROPERTY
public static final String ND4J_TEMP_DIR_PROPERTY
Applicability: ND4J Temporary file creation/extraction for ClassPathResource, memory mapped workspaces, and
Description: Specify the local directory where temporary files will be written. If not specified, the default Java temporary directory (java.io.tmpdir system property) will generally be used.- See Also:
- Constant Field Values
-
DYNAMIC_LOAD_CLASSPATH_PROPERTY
public static final String DYNAMIC_LOAD_CLASSPATH_PROPERTY
Applicability: always - but only if an ND4J backend cannot be found/loaded via standard ServiceLoader mechanisms
Description: Set this property 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, seeND4JEnvironmentVars.BACKEND_DYNAMIC_LOAD_CLASSPATHfor the equivalent system property (the system property will take precidence if both are set)- See Also:
- Constant Field Values
-
VERSION_CHECK_PROPERTY
public static final String VERSION_CHECK_PROPERTY
Applicability: Always
Description Setting the system property to false will stop ND4J from performing the version check, and logging any warnings/errors. By default, the version check is enabled.
Note: the version check is there for a reason! Using incompatible versions of ND4J/DL4J etc is likely to cause issues, and should be avoided.- See Also:
- Constant Field Values
-
DATABUFFER_TO_STRING_MAX_ELEMENTS
public static final String DATABUFFER_TO_STRING_MAX_ELEMENTS
Applicability: always
Description: Used to specify the maximum number of elements (numbers) to print when using DataBuffer.toString(). Use -1 to print all elements (i.e., no limit). This is usually to avoid expensive toString() calls on buffers which may have millions of elements - for example, in a debugger
Default: 1000- See Also:
- Constant Field Values
-
ND4J_CPU_LOAD_OPENBLAS
public static final String ND4J_CPU_LOAD_OPENBLAS
Applicability: nd4j-native backend, when multiple BLAS libraries are available
Description: This system property can be used to control which BLAS library is loaded and used by ND4J. For example,org.bytedeco.javacpp.openblas.load=mkl_rtcan be used to load a default installation of MKL. However, MKL is liked with by default (when available) so setting this option explicitly is not usually required. For more details, see https://github.com/bytedeco/javacpp-presets/tree/master/openblas#documentation- See Also:
- Constant Field Values
-
ND4J_CPU_LOAD_OPENBLAS_NOLAPACK
public static final String ND4J_CPU_LOAD_OPENBLAS_NOLAPACK
Applicability: nd4j-native backend, when multiple BLAS libraries are available
Description: This system property can be used to control which BLAS library is loaded and used by ND4J. Similar toND4J_CPU_LOAD_OPENBLASbut when this is set, LAPACK will not be loaded- See Also:
- Constant Field Values
-
AERON_TERM_BUFFER_PROP
public static final String AERON_TERM_BUFFER_PROP
Applicability: nd4j-parameter-server, dl4j-spark (gradient sharing training master)
Description: Aeros in a high-performance communication library used in distributed computing contexts in some places in ND4J and DL4J. This term buffer length determines the maximum message length that can be sent via Aeron in a single message. It can be increased to avoid exceptions such asEncoded message exceeds maxMessageLength of 2097152, at the expense of increased memory consumption (memory consumption is a multiple of this). It is specified in bytes with no unit suffix. Default value: 33554432 (32MB). IMPORTANT: This value must be an exact power of 2.
Note also the maximum effective size is 128MB (134217728) (due to Aeron internal limits - beyond which increasing the buffer size will have no effect)- See Also:
- Constant Field Values
-
RESOURCES_CACHE_DIR
public static final String RESOURCES_CACHE_DIR
Applicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources from a Strumpf resource file (Example:Resources.asFile("myFile.txt")where should the remote files be downloaded to?
This is generally used for resolving test resources, but can be used for Strumpf resource files generally.- See Also:
- Constant Field Values
-
RESOURCES_CONNECTION_TIMEOUT
public static final String RESOURCES_CONNECTION_TIMEOUT
Applicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources from a Strumpf resource file (Example:Resources.asFile("myFile.txt")what should be the connection timeout, as used byFileUtils.copyURLToFile(URL, File, int, int)
Default:ResourceFile#DEFAULT_CONNECTION_TIMEOUT- See Also:
- Constant Field Values
-
RESOURCES_READ_TIMEOUT
public static final String RESOURCES_READ_TIMEOUT
Applicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources from a Strumpf resource file (Example:Resources.asFile("myFile.txt")what should be the connection timeout, as used byFileUtils.copyURLToFile(URL, File, int, int)
Default:ResourceFile#DEFAULT_READ_TIMEOUT- See Also:
- Constant Field Values
-
RESOURCES_LOCAL_DIRS
public static final String RESOURCES_LOCAL_DIRS
Applicability: nd4j-commonResourcesclass (and henceStrumpfResolver)
Description: When resolving resources, what local directories should be checked (in addition to the classpath) for files? This is optional. Multiple directories may be specified, using comma-separated paths- See Also:
- Constant Field Values
-
SAMEDIFF_MEMORY_CACHE_DISABLE
public static final String SAMEDIFF_MEMORY_CACHE_DISABLE
Whether caching should be enabled for samediff memory managers. This ia mainly for the default ArrayCacheMemoryMgr. Sometimes arrays for performance reasons get reused during a samediff inference session. This may have bad side effects (especially involving views) This allows enabling or disabling of that behavior.- See Also:
- Constant Field Values
-
INIT_IMPORT_REFLECTION_CACHE
public static final String INIT_IMPORT_REFLECTION_CACHE
Used to trigger loading the import reflection cache. This allows the user to control the initial scan of the ImportReflectionCache in samediff-import-onnx and samediff-import-tensorflow. Sometimes delayed initialization is favorable for use cases like graalvm AOT.- See Also:
- Constant Field Values
-
CLASS_GRAPH_SCAN_RESOURCES
public static final String CLASS_GRAPH_SCAN_RESOURCES
Used to point to a json resource that contains json for a ClassGraph ScanResult. This may be needed when using AOT. Graalvm can not handle classpath scanning very well. A pre scanned resource option will allow model import that relies on annotation scanning to operate even when using AOT.- See Also:
- Constant Field Values
-
INIT_NATIVEOPS_HOLDER
public static final String INIT_NATIVEOPS_HOLDER
Whether to initialize the native ops holder or not. Depending on whether we are running in native image or not, disabling automatic initialization and setting the relevant native ops elsewhere might be necessary. For more seeorg.nd4j.nativeblas.NativeOpsHolder- See Also:
- Constant Field Values
-
-