mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Fix mshadow broken basic_stream example

Open litaotju opened this issue 5 years ago • 1 comments

Description

The NewTensor and NewStream API had changed to different signatures while the basic_stream.cu sample still use the incorrect interface.

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)
  • [x ] Changes are complete (i.e. I finished coding on this PR)
  • [x] 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 https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • [x] To the best of my 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

litaotju avatar Jan 18 '20 09:01 litaotju

Any tests to confirm the change?

@ChaiBapchya Tested with the following edited config.mk. The sample only compiled when USE_CUDA=1. Since not all user use CUDA, I didn't make it on-by-default.

diff --git a/3rdparty/mshadow/guide/config.mk b/3rdparty/mshadow/guide/config.mk
index 26431bb06..9ebc4f685 100644
--- a/3rdparty/mshadow/guide/config.mk
+++ b/3rdparty/mshadow/guide/config.mk
@@ -13,21 +13,22 @@
 #----------------------------------------------------------------------------------------

 # whether use CUDA during compile
-USE_CUDA = 0
+USE_CUDA = 1

 # add the path to CUDA libary to link and compile flag
 # if you have already add them to enviroment variable, leave it as NONE
-USE_CUDA_PATH = NONE
+USE_CUDA_PATH = /usr/local/cuda

 #
 # choose the version of blas you want to use
 # can be: mkl, blas, atlas, openblas, apple
-USE_BLAS = blas
+USE_BLAS = mkl
 #
 # add path to intel library, you may need it
 # for MKL, if you did not add the path to enviroment variable
 #
-USE_INTEL_PATH = NONE
+USE_INTEL_PATH = /opt/intel/
+USE_STATIC_MKL = NONE

 # whether compile with parameter server
 USE_DIST_PS = 0
(END)

Complete config.mk is here. https://gist.github.com/litaotju/5954a59cf9d4f4b0f3daf22a58794426

litaotju avatar Jan 19 '20 05:01 litaotju