Overview

In recently performance testing, we uncovered some performance discrepancy between Scala package and python package. And a JIRA issue was created to track the issue: https://issues.apache.org/jira/browse/MXNET-1224

Issues in Scala maven build

Proposed solution

Decouple make build maven build

To make sure in sync with release MXNet library (libmxnet.so), scala jni will stop static linking libmxnet.a, instead dynamically link to libmxnet.so. Scala jni library become a thin wrapper around libmxnet.so.

Changes need to dynamically link to libmxnet.so:


Packaging

Since we no longer static link with libmxnet.a, we no longer need to generate cpu/gpu flavor of Scala jni, the released package on maven central can be:


Other build improvement

Auto detect platform and cpu/gpu package

Current Scala build doesn't support cross platform build. osx and linux build has to be build on each platform. We should be able to auto detect platform and generate correct artifact for corresponding platform. Further more, we should detect if bundled libmxnet.so is for gpu or cpu and name the package name properly.

With this change, we can consolidate linux_x86-64-cpu and linux_x86-64-gpu into single profile. For developer the only thing they need to do is: mvn package

Improve unittest and integrationtest

In current maven pom.xml file, we defined two profiles “unittest” and “integrationtest”. This is not the maven way of doing thing.

The right approach is:


Better support for incremental build

Proposal: See next section

Resolve cyclic module dependencies

Current there are cyclic module dependencies:

Proposal: