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
Merged

Fix MXNet R package build #13952

merged 12 commits into from
Jan 31, 2019

Conversation

jitMatrix
Copy link
Contributor

@jitMatrix jitMatrix commented Jan 22, 2019

Description

As mentioned in #13859 & #13936 , below error will occur when building R-Package on my ubuntu:

make[1]: Leaving directory '/root/incubator-mxnet/R-package/src'
installing to /usr/local/lib/R/site-library/mxnet/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
No man pages found in package  'mxnet'
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
[1] "Loading local: inst/libs/libmxnet.so"
Error: package or namespace load failed for 'mxnet':
 .onLoad failed in loadNamespace() for 'mxnet', details:
  call: dyn.load("R-package/inst/libs/libmxnet.so", local = FALSE)
  error: unable to load shared object '/root/incubator-mxnet/R-package/R-package/inst/libs/libmxnet.so':
  /root/incubator-mxnet/R-package/R-package/inst/libs/libmxnet.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/usr/local/lib/R/site-library/mxnet'
Makefile:599: recipe for target 'rpkg' failed
make: *** [rpkg] Error 1

It seems that some dependent libraries of mxnet should also be copied to R directory.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@jitMatrix jitMatrix requested a review from szha as a code owner January 22, 2019 06:42
@pengzhao-intel
Copy link
Contributor

@xinyu-intel could you help take a review? Does this PR conflict with yours #13867 ?

@xinyu-intel
Copy link
Contributor

@rajeshii Hi, thanks for your contribution! Can you also help add R unittest with MKL-DNN to the CI(./ci/jenkins/Jenkins_steps.groovy)?

@jitMatrix
Copy link
Contributor Author

@xinyu-intel @pengzhao-intel Added and passed the CI:)

@pengzhao-intel
Copy link
Contributor

@hetong007 could you help take a review?

@hetong007
Copy link
Contributor

LGTM. @marcoabreu do you have any comments?

@@ -53,6 +53,7 @@ core_logic: {
custom_steps.test_unix_python3_tensorrt_gpu(),
custom_steps.test_unix_perl_gpu(),
custom_steps.test_unix_r_gpu(),
custom_steps.test_unix_r_mkldnn_gpu(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure whether we need GPU+MKLDNN for R since we already test it in python. Could you elaborate what concerns you are specifically having?

@marcoabreu
Copy link
Contributor

Ideally, we could do some smoketests for different compilation options by running a simple test to ensure everything is working. Considering we test different backends in Python already, I don't think there's much benefit of now testing the full spectrum across the different frontend languages. As far as I understand, the goal is to ensure everything gets compiled and linked properly, right?

@TaoLv
Copy link
Member

TaoLv commented Jan 24, 2019

Agree that we only need run minimal tests to make sure libraries can be found and properly linked during runtime.

@pengzhao-intel
Copy link
Contributor

@marcoabreu @TaoLv could you help to take a review again?

Copy link
Contributor

@pengzhao-intel pengzhao-intel left a comment

Choose a reason for hiding this comment

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

LGTM

@marcoabreu
Copy link
Contributor

marcoabreu commented Jan 25, 2019 via email

Copy link
Contributor

@pengzhao-intel pengzhao-intel left a comment

Choose a reason for hiding this comment

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

@marcoabreu sorry, I mixed up the different PR.

@rajeshii could you update the PR based on the change request?

@sandeep-krishnamurthy sandeep-krishnamurthy added R CI pr-awaiting-response PR is reviewed and waiting for contributor to respond labels Jan 25, 2019
@jitMatrix
Copy link
Contributor Author

@marcoabreu Sorry for the late response. I'm confused that whether I should skip the rpkg test for mkldnn backend and leave only the rpkg build in CI or I need to add a lite test for it. For the later one, I don't know how to design the test. What's your opinion @hetong007 ?

@marcoabreu
Copy link
Contributor

marcoabreu commented Jan 28, 2019 via email

@jitMatrix
Copy link
Contributor Author

@marcoabreu addressed your comments. It seems that all tests have passed but the CI is pending...

@jitMatrix
Copy link
Contributor Author

Rebase three times with different kinds of CI failures:(

@jitMatrix
Copy link
Contributor Author

@pengzhao-intel @xinyu-intel @marcoabreu All tests pass now:)

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.

@hetong007 hetong007 merged commit 47277b0 into apache:master Jan 31, 2019
stephenrawls pushed a commit to stephenrawls/incubator-mxnet that referenced this pull request Feb 16, 2019
* 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
vdantu pushed a commit to vdantu/incubator-mxnet that referenced this pull request Mar 31, 2019
* 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
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI pr-awaiting-response PR is reviewed and waiting for contributor to respond R
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants