You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by th...@apache.org on 2019/01/31 06:25:51 UTC
[incubator-mxnet] branch master updated: Fix MXNet R package build
(#13952)
This is an automated email from the ASF dual-hosted git repository.
the pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 47277b0 Fix MXNet R package build (#13952)
47277b0 is described below
commit 47277b09667df09158bc192768099316d404d0d4
Author: rajeshii <46...@users.noreply.github.com>
AuthorDate: Wed Jan 30 22:25:29 2019 -0800
Fix MXNet R package build (#13952)
* fix mxnet r package build
* add ci
* remove mkldnn-gpu test for R
* add minimal test for MKLDNN-R
* pick mlp as minimal R test
---
Makefile | 7 +++++++
ci/docker/runtime_functions.sh | 30 ++++++++++++++++++++++++++++++
ci/jenkins/Jenkins_steps.groovy | 14 ++++++++++++++
ci/jenkins/Jenkinsfile_unix_cpu | 1 +
4 files changed, 52 insertions(+)
diff --git a/Makefile b/Makefile
index c6334fb..cc7aebc 100644
--- a/Makefile
+++ b/Makefile
@@ -599,6 +599,13 @@ rpkg:
mkdir -p R-package/inst/libs
cp src/io/image_recordio.h R-package/src
cp -rf lib/libmxnet.so R-package/inst/libs
+
+ if [ -e "lib/libmkldnn.so.0" ]; then \
+ cp -rf lib/libmkldnn.so.0 R-package/inst/libs; \
+ cp -rf lib/libiomp5.so R-package/inst/libs; \
+ cp -rf lib/libmklml_intel.so R-package/inst/libs; \
+ fi
+
mkdir -p R-package/inst/include
cp -rf include/* R-package/inst/include
rm R-package/inst/include/dmlc
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index d97da64..7820d3d 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -902,6 +902,36 @@ unittest_ubuntu_cpu_R() {
make rpkgtest R_LIBS=/tmp/r-site-library
}
+unittest_ubuntu_minimal_R() {
+ set -ex
+ mkdir -p /tmp/r-site-library
+ # build R packages in parallel
+ mkdir -p ~/.R/
+ build_ccache_wrappers
+ echo "MAKEFLAGS = -j"$(nproc) > ~/.R/Makevars
+ # make -j not supported
+ make rpkg \
+ USE_BLAS=openblas \
+ R_LIBS=/tmp/r-site-library
+
+ R CMD INSTALL --library=/tmp/r-site-library R-package
+ # pick mlp as minimal R test
+ R_LIBS=/tmp/r-site-library \
+ Rscript -e "library(mxnet); require(mlbench); \
+ data(Sonar, package=\"mlbench\"); \
+ Sonar[,61] = as.numeric(Sonar[,61])-1; \
+ train.ind = c(1:50, 100:150); \
+ train.x = data.matrix(Sonar[train.ind, 1:60]); \
+ train.y = Sonar[train.ind, 61]; \
+ test.x = data.matrix(Sonar[-train.ind, 1:60]); \
+ test.y = Sonar[-train.ind, 61]; \
+ model = mx.mlp(train.x, train.y, hidden_node = 10, \
+ out_node = 2, out_activation = \"softmax\", \
+ learning.rate = 0.1, \
+ array.layout = \"rowmajor\"); \
+ preds = predict(model, test.x, array.layout = \"rowmajor\")"
+}
+
unittest_ubuntu_gpu_R() {
set -ex
mkdir -p /tmp/r-site-library
diff --git a/ci/jenkins/Jenkins_steps.groovy b/ci/jenkins/Jenkins_steps.groovy
index f1703ba..5986eaf 100644
--- a/ci/jenkins/Jenkins_steps.groovy
+++ b/ci/jenkins/Jenkins_steps.groovy
@@ -927,6 +927,20 @@ def test_unix_r_cpu() {
}]
}
+def test_unix_r_mkldnn_cpu() {
+ return ['R: MKLDNN-CPU': {
+ node(NODE_LINUX_CPU) {
+ ws('workspace/ut-r-mkldnn-cpu') {
+ timeout(time: max_time, unit: 'MINUTES') {
+ utils.unpack_and_init('mkldnn_cpu', mx_mkldnn_lib, true)
+ utils.docker_run('ubuntu_cpu', 'unittest_ubuntu_minimal_R', false)
+ utils.publish_test_coverage()
+ }
+ }
+ }
+ }]
+}
+
def test_unix_perl_cpu() {
return ['Perl: CPU': {
node(NODE_LINUX_CPU) {
diff --git a/ci/jenkins/Jenkinsfile_unix_cpu b/ci/jenkins/Jenkinsfile_unix_cpu
index 234a65b..919381e 100644
--- a/ci/jenkins/Jenkinsfile_unix_cpu
+++ b/ci/jenkins/Jenkinsfile_unix_cpu
@@ -55,6 +55,7 @@ core_logic: {
custom_steps.test_unix_clojure_integration_cpu(),
custom_steps.test_unix_perl_cpu(),
custom_steps.test_unix_r_cpu(),
+ custom_steps.test_unix_r_mkldnn_cpu(),
custom_steps.test_unix_julia07_cpu(),
custom_steps.test_unix_julia10_cpu(),
custom_steps.test_unix_onnx_cpu(),