You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/12 00:25:58 UTC

[GitHub] ctcyang opened a new pull request #11237: Bring back MXNET_GPU_COPY_NTHREADS env variable

ctcyang opened a new pull request #11237: Bring back MXNET_GPU_COPY_NTHREADS env variable
URL: https://github.com/apache/incubator-mxnet/pull/11237
 
 
   ## Description ##
   (Brief description on what this PR is about)
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [x] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 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)
   - [x] 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
   - [x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [x] Restores MXNET_GPU_COPY_NTHREADS environmental variable
   - [x] This variable has been set to MXNET_GPU_WORKER_THREADS (default = 2) since MXNet v0.10.0, so env_var doc is changed to reflect that
   
   ## Comments ##
   - This MXNET_GPU_COPY_NTHREADS environmental variable was (accidentally) removed in commit 3b517f1 with the value taking the value of MXNET_GPU_WORKER_NTHREADS. Then, shortly afterwards the member variable was itself removed in this PR: https://github.com/apache/incubator-mxnet/pull/6773. Since then, it has been set to MXNET_GPU_WORKER_NTHREADS, which is 2.
   - Since this variable controls how many CUDA streams are launched in order to do copying from GPU to GPU, it might be good to bring it back so the user has another knob they can use to tune single-machine multi-GPU training.
   - Some experimental evidence that 2 may be better than 1. From running `tools/bandwidth/measure.py` on ResNet-50.
   
   ```
   export MXNET_GPU_COPY_NTHREADS=1
   INFO:root:iter 1, 0.033930 sec, 5.261591 GB/sec per gpu, error 0.000000
   INFO:root:iter 2, 0.033478 sec, 5.332636 GB/sec per gpu, error 0.000000
   INFO:root:iter 3, 0.044507 sec, 4.011239 GB/sec per gpu, error 0.000000
   INFO:root:iter 4, 0.034598 sec, 5.159997 GB/sec per gpu, error 0.000000
   INFO:root:iter 5, 0.038231 sec, 4.669686 GB/sec per gpu, error 0.000000
   export MXNET_GPU_COPY_NTHREADS=2
   INFO:root:iter 1, 0.031341 sec, 5.696318 GB/sec per gpu, error 0.000000
   INFO:root:iter 2, 0.031575 sec, 5.654080 GB/sec per gpu, error 0.000000
   INFO:root:iter 3, 0.035124 sec, 5.082800 GB/sec per gpu, error 0.000000
   INFO:root:iter 4, 0.030341 sec, 5.884048 GB/sec per gpu, error 0.000000
   INFO:root:iter 5, 0.032198 sec, 5.544681 GB/sec per gpu, error 0.000000
   export MXNET_GPU_COPY_NTHREADS=4
   INFO:root:iter 1, 0.046252 sec, 3.859864 GB/sec per gpu, error 0.000000
   INFO:root:iter 2, 0.034504 sec, 5.174116 GB/sec per gpu, error 0.000000
   INFO:root:iter 3, 0.039854 sec, 4.479529 GB/sec per gpu, error 0.000000
   INFO:root:iter 4, 0.034815 sec, 5.127841 GB/sec per gpu, error 0.000000
   INFO:root:iter 5, 0.034434 sec, 5.184613 GB/sec per gpu, error 0.000000
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services