* fix extra quote inserted by intellij * Fix path * fix executable permissions usage * improve directory resolution and restore some files from the previous PR * remove old unused dep versions Update to new march 2024 central release plugin * update central publishing version * temp disable mirror * fix hallucinated version * update maven invoker version for jetspeed * remove old build properties add better directory resolution for copy flatc * fix helpers sources for cpu (api updates) perform maven antrun upgrade * more fixes for onednn helpers * update more antrun usage * fix pooling param usage * remove findbugs on the 2 files it was used on * debug odd build path issues * try again * remove bad ls * try again * another attempt * Add troubleshooting logs again * Remove specific gcc versions * update build * cd to original directory instead * Remove enforcer check * remove debug steps * remove extra steps * update linux, android and cuda versions * update arm usage defaults * remove 32 bit builds * alternative path * alternative path get rid of old tools * get rid of over simplified bootstrap libnd4j download usage * remove extra cmake * remove manual path setting * arm compilation fix * debug armcompute * update android-x86_64 openblas * upgrade gcc * minor armcompute const changes * update openblas version * fix armcompute paths * remove ls * update cuda versions and envrionment variables * fix syntax errors * fix syntax errors * fix syntax errors * fix syntax errors * another rev * update msys command * rev * fix classifier * rev android-x86_64 * rev android-x86_64 * update cuda env passing * fix linux-arm64 syntax error * cuda rev * cuda rev * update arm else if branches for matching * remove external PS script? * remove external PS script? * remove external PS script? * improve architecture detection * update list operation conv2d armcompute * add flatbuffer generated code * remove old maven auth * remove old legacny average and accumulate * remove cache due to 422 error * ensure armcompute is optional * ensure armcompute is optional * disk space clean up on all workflows * deal with windows service issue * ensure nvcc is on path * Add arm64 protoc Update cuda paths * convert to use numeric types only mitigating lld errors found by clang * Add arm64 protoc Update cuda paths * fix syntax error * fix overriding properties causing libnd4j not to be built with cuda * update windows version * try to update cl.exe paths * update debugging for nvcc * update cuda flags to work with linux/windows * remove extra cuda install * fix duplicate sources * more unsupported compiler changes * remove unneeded source and javadoc * better cudnn detection * update where we put unsupported compiler * Collapse cmake logic * Collapse cmake logic * clean up consolidated file * flatbuffers fix * fix hallucinated paths * generate flatbuffers by default * fix hallucinated paths * ensure imports present * fix flatc target order * fix elif syntax * more rearrange * fix git tag * update template to allow proper configuration generation * remove guard * change quotes * change quotes * test default * fix missing functions * rearrange dependencies * set the engine * reintegrate some old cuda logic * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * Add back in function defs * update api to use proper cuda versions * update api to use proper cuda versions * update api to use proper cuda versions * Add back in function defs * delete old paths * aDd back include_ops.h generation * delete old paths * reinroduce old comand * delete old paths * delete old paths * better tar unpacking * fix for suffixes * Add missing cpu sources * fix duplicate profile * change mac image * change mac image * get rid of old gpg key step * get rid of javadoc on mac * remove unneeded deps for mac * update arm compute path * remove old command checks * remove gpg key step * clang specific type erro * clang specific type erro * add another missing cpu path * add another missing cpu path * fix helpers sources ordering * fix helpers sources ordering * Add back createFromDescriptor * fix helpers sources ordering * fix helpers sources ordering * fix helpers sources ordering * fix helpers sources ordering * Add back createFromDescriptor * add debug for onednn * add debug for onednn * SFINAE for type aliases * SFINAE for type aliases * SFINAE for type aliases * SFINAE for type aliases * ensure we tell compiler we're ok with certain apple version minimums * ensure we tell compiler we're ok with certain apple version minimums * ensure we tell compiler we're ok with certain apple version minimums * ensure we tell compiler we're ok with certain apple version minimums * fix imports * update linker path * fix lock type usage * change order of sources * share mutex types * share mutex types * share mutex types * update linker path * share mutex types * share mutex types * share mutex types * decrease type pairs for sort * decrease type pairs for sort * decrease type pairs for sort * decrease type pairs for sort * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * update the special methods to use combinations * standardize output paths * fix template paths * refactor compiler flags * update onednn to use similar approach to armcompute * refactor compiler flags * fix paths * fix paths * fix paths * fix paths * fix paths * fix paths * fix paths * fix paths * change target expand types * change target expand types * add new pairwise types * add new pairwise types * add new pairwise types * update linker paths * add new pairwise types * add new pairwise types * add new pairwise types * fix strings with transform * fix strings with transform * update linker paths * update default values for libnd4j.outputPath * update default values for libnd4j.outputPath * update default values for libnd4j.outputPath * update pom.xml namespaces * Update .github/workflows/build-deploy-linux-cuda-12.6.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/build-deploy-linux-x86_64.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
6.9 KiB
The Eclipse Deeplearning4J (DL4J) ecosystem is a set of projects intended to support all the needs of a JVM based deep learning application. This means starting with the raw data, loading and preprocessing it from wherever and whatever format it is in to building and tuning a wide variety of simple and complex deep learning networks.
Because Deeplearning4J runs on the JVM you can use it with a wide variety of JVM based languages other than Java, like Scala, Kotlin, Clojure and many more.
The DL4J stack comprises of:
- DL4J: High level API to build MultiLayerNetworks and ComputationGraphs with a variety of layers, including custom ones. Supports importing Keras models from h5, including tf.keras models (as of 1.0.0-beta7) and also supports distributed training on Apache Spark
- ND4J: General purpose linear algebra library with over 500 mathematical, linear algebra and deep learning operations. ND4J is based on the highly-optimized C++ codebase LibND4J that provides CPU (AVX2/512) and GPU (CUDA) support and acceleration by libraries such as OpenBLAS, OneDNN (MKL-DNN), cuDNN, cuBLAS, etc
- SameDiff : Part of the ND4J library, SameDiff is our automatic differentiation / deep learning framework. SameDiff uses a graph-based (define then run) approach, similar to TensorFlow graph mode. Eager graph (TensorFlow 2.x eager/PyTorch) graph execution is planned. SameDiff supports importing TensorFlow frozen model format .pb (protobuf) models. Import for ONNX, TensorFlow SavedModel and Keras models are planned. Deeplearning4j also has full SameDiff support for easily writing custom layers and loss functions.
- DataVec: ETL for machine learning data in a wide variety of formats and files (HDFS, Spark, Images, Video, Audio, CSV, Excel etc)
- LibND4J : C++ library that underpins everything. For more information on how the JVM acceses native arrays and operations refer to JavaCPP
- Python4J: Bundled cpython execution for the JVM
All projects in the DL4J ecosystem support Windows, Linux and macOS. Hardware support includes CUDA GPUs (10.0, 10.1, 10.2 except OSX), x86 CPU (x86_64, avx2, avx512), ARM CPU (arm, arm64, armhf) and PowerPC (ppc64le).
Community Support
For support for the project, please go over to https://community.konduit.ai/
Using Eclipse Deeplearning4J in your project
Deeplearning4J has quite a few dependencies. For this reason we only support usage with a build tool.
<dependencies>
<dependency>
<groupId>org.eclipse.deeplearning4j</groupId>
<artifactId>deeplearning4j-core</artifactId>
<version>1.0.0-M2.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.deeplearning4j</groupId>
<artifactId>nd4j-native-platform</artifactId>
<version>1.0.0-M2.1</version>
</dependency>
</dependencies>
Add these dependencies to your pom.xml file to use Deeplearning4J with the CPU backend. A full standalone project example is available in the example repository, if you want to start a new Maven project from scratch.
Code samples
Due to DL4J being a multi faceted project with several modules in the mono repo, we recommend looking at the examples for a taste of different usages of the different modules. Below we'll link to examples for each module.
- ND4J: https://github.com/deeplearning4j/deeplearning4j-examples/tree/master/nd4j-ndarray-examples
- DL4J: https://github.com/deeplearning4j/deeplearning4j-examples/tree/master/dl4j-examples
- Samediff: https://github.com/deeplearning4j/deeplearning4j-examples/tree/master/samediff-examples
- Datavec: https://github.com/deeplearning4j/deeplearning4j-examples/tree/master/data-pipeline-examples
- Python4j: https://deeplearning4j.konduit.ai/python4j/tutorials/quickstart
For users looking for being able to run models from other frameworks, see:
- Onnx: https://github.com/deeplearning4j/deeplearning4j-examples/tree/master/onnx-import-examples
- Tensorflow/Keras: https://github.com/deeplearning4j/deeplearning4j-examples/tree/master/tensorflow-keras-import-examples
Documentation, Guides and Tutorials
You can find the official documentation for Deeplearning4J and the other libraries of its ecosystem at http://deeplearning4j.konduit.ai/.
Want some examples?
We have separate repository with various examples available: https://github.com/eclipse/deeplearning4j-examples
Building from source
It is preferred to use the official pre-compiled releases (see above). But if you want to build from source, first take a look at the prerequisites for building from source here: https://deeplearning4j.konduit.ai/multi-project/how-to-guides/build-from-source. Various instructions for cpu and gpu builds can be found there. Please go to our forums for further help.
Running tests
In order to run tests, please see the platform-tests module. This module only runs on jdk 11 (mostly due to spark and bugs with older scala versions + JDK 17)
platform-tests allows you to run dl4j for different backends. There are a few properties you can specify on the command line:
- backend.artifactId: this defaults to nd4j-native and will run tests on cpu,you can specify other backends like nd4j-cuda-11.6
- dl4j.version: You can change the dl4j version that the tests run against. This defaults to 1.0.0-SNAPSHOT.
More parameters can be found here: https://github.com/deeplearning4j/deeplearning4j/blob/c1bf8717e4839c8930e9c43183bf7b94d0cf84dc/platform-tests/pom.xml#L47
Running project in Intellij IDEA:
- Ensure you follow https://stackoverflow.com/questions/45370178/exporting-a-package-from-system-module-is-not-allowed-with-release on jdk 9 or later
- Ignore all nd4j-shade submodules. Right click on each folder and click: Maven -> Ignore project
License
Commercial Support
Deeplearning4J is actively developed by the team at Konduit K.K..
[If you need any commercial support feel free to reach out to us. at support@konduit.ai
