Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix MXNet R package build #13952

Merged
merged 12 commits into from
Jan 31, 2019
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,22 @@ 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
R_LIBS=/tmp/r-site-library Rscript -e "library(mxnet); as.array(mx.nd.ones(c(2,3)))"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a more meaningful test, like convolution, FC or relu which will hit the real MKLDNN calculation?
We need to guarantee R can execute at least in the CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pengzhao-intel Has changed to use mlp.

}

unittest_ubuntu_gpu_R() {
set -ex
mkdir -p /tmp/r-site-library
Expand Down
14 changes: 14 additions & 0 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions ci/jenkins/Jenkinsfile_unix_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down