...
MXNet-Scala is a Scala binding for the MXNet Deep Learning framework. It currently supports Training and Inference
MXNet-Scala Modules
Module | Package Generated | Dependencies | Description |
---|---|---|---|
|
|
| |
2. core | mxnet-core_2.11 |
| |
3. macros | mxnet-macros_2.11 |
| |
4. init | mxnet-init_2.11 |
...
5. init-native |
| mxnet-init_2.11 | |
6. native |
| mxnet-core_2.11 | |
7. infer | mxnet-infer_2.11 |
| |
8. spark | mxnet-spark_2.11 |
| |
9. examples | mxnet-examples_2.11 |
|
Publishing Scala Packages to Nexus/Maven
Currently 3 Packages from the above generated are published to Maven. `mxnet_full_2.11-{platform}`.
The following flags are used to build the MXNet Backend(derived from mxnet pip compiler flags)
...
MXNet-Scala Linux CPU
...
USE_CUDNN
...
1
...
$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
...
ubuntu@ip:~$ java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (Zulu 8.20.0.5-linux64) (build 1.8.0_121-b15)
OpenJDK 64-Bit Server VM (Zulu 8.20.0.5-linux64) (build 25.121-b15, mixed mode)
Setup GPG Keys
Build MXNet backend on OSX
- Clone MXNet repo and checkout the release branch
Code Block | ||||
---|---|---|---|---|
| ||||
https://github.com/apache/incubator-mxnet.git ~/$MXNET_LOC
git fetch all
git checkout -b $RELEASE_BRANCH
cp ~/$MXNET_LOC/make/config.mk ~/$MXNET_LOC |
2. Install Lapack
Code Block | ||
---|---|---|
| ||
brew install lapack |
setup all the flags
Code Block |
---|
echo "ADD_CFLAGS += -I/usr/local/opt/lapack/include" >> ~/$MXNET_LOC/config.mk
echo "ADD_LDFLAGS += -L/usr/local/opt/lapack/lib" >> ~/$MXNET_LOC/config.mk
echo "USE_OPENMP = 0" >> ~/$MXNET_LOC/config.mk |
Build MXNet backend on Linux-CPU
To build for linux-cpu platform, we use the AWS Deep Learning Base AMI that comes built with all the necessary
libraries such as opencv/cudnn etc,.
Install Maven on Ubuntu
Code Block | ||
---|---|---|
| ||
sudo apt-get install -y maven |
setup all the flags
Code Block |
---|
echo "ADD_CFLAGS += -I/usr/local/include/opencv" >> ./config.mk
echo "ADD_LDFLAGS += -L/usr/local/lib" >> ./config.mk
echo "USE_BLAS=" >> ./config.mk
echo "USE_SIGNAL_HANDLER=1" >> ./config.mk
echo "USE_DIST_KVSTORE=1" >> ./config.mk
echo "USE_S3=1" >> ./config.mk
echo "USE_OPENMP=1" >> ./config.mk |
Note: compiling with OpenBlas throws a segmentation fault on both OSX and Linux platforms
Code Block | ||||
---|---|---|---|---|
| ||||
[INFO] --- maven-scala-plugin:2.15.2:compile (default) @ mxnet-core_2.11 ---
[INFO] Checking for multiple versions of scala
[WARNING] Expected all dependencies to require Scala version: 2.11.8
[WARNING] org.apache.mxnet:mxnet-init_2.11:1.2.0-SNAPSHOT requires scala version: 2.11.8
[WARNING] org.apache.mxnet:mxnet-init_2.11:1.2.0-SNAPSHOT requires scala version: 2.11.8
[WARNING] org.apache.mxnet:mxnet-core_2.11:1.2.0-SNAPSHOT requires scala version: 2.11.8
[WARNING] org.scala-lang:scala-reflect:2.11.8 requires scala version: 2.11.8
[WARNING] org.scalatest:scalatest_2.11:3.0.4 requires scala version: 2.11.11
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] /home/ubuntu/incubator-mxnet/scala-package/core/src/main/scala:-1: info: compiling
[INFO] Compiling 51 source files to /home/ubuntu/incubator-mxnet/scala-package/core/target/classes at 1527282462191
[INFO] compiler plugin: BasicArtifact(org.scalamacros,paradise_2.11.8,2.1.0)
[INFO]
[INFO] Segmentation fault: 11
[INFO]
[INFO] Stack trace returned 10 entries:
[INFO] [bt] (0) /home/ubuntu/incubator-mxnet/scala-package/init-native/linux-x86_64/target/libmxnet-init-scala-linux-x86_64.so(dmlc::StackTrace[abi:cxx11]()+0x1bc) [0x7fd294ea735c]
[INFO] [bt] (1) /home/ubuntu/incubator-mxnet/scala-package/init-native/linux-x86_64/target/libmxnet-init-scala-linux-x86_64.so(+0x2fc40af) [0x7fd29799e0af]
[INFO] [bt] (2) /lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7fd33fea24b0]
[INFO] [bt] (3) /home/ubuntu/anaconda3/jre/lib/amd64/server/libjvm.so(+0x40ddf1) [0x7fd33d67edf1]
[INFO] [bt] (4) /home/ubuntu/anaconda3/jre/lib/amd64/server/libjvm.so(+0x9f55c8) [0x7fd33dc665c8]
[INFO] [bt] (5) /home/ubuntu/anaconda3/jre/lib/amd64/server/libjvm.so(+0x9ef260) [0x7fd33dc60260]
[INFO] [bt] (6) /home/ubuntu/anaconda3/jre/lib/amd64/server/libjvm.so(+0x9f2e8e) [0x7fd33dc63e8e]
[INFO] [bt] (7) /home/ubuntu/anaconda3/jre/lib/amd64/server/libjvm.so(+0x9f2db5) [0x7fd33dc63db5]
[INFO] [bt] (8) /home/ubuntu/anaconda3/jre/lib/amd64/server/libjvm.so(+0x3f0e52) [0x7fd33d661e52]
[INFO] [bt] (9) /home/ubuntu/anaconda3/jre/lib/amd64/server/libjvm.so(+0x8e811d) [0x7fd33db5911d]
[INFO] ------------------------------------------------------------------------ |
Publishing to Maven
Code Block | ||
---|---|---|
| ||
export GPG_TTY=$(tty)
make scalapkg
make scalarelease-dryrun |
...