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 2019/01/13 02:14:15 UTC

[GitHub] eric-haibin-lin opened a new pull request #13866: Environment variable for cuda parallel random number generator

eric-haibin-lin opened a new pull request #13866: Environment variable for cuda parallel random number generator 
URL: https://github.com/apache/incubator-mxnet/pull/13866
 
 
   ## Description ##
   The number of parallel threads for GPU random number generation is controlled by two variables: `kMinNumRandomPerThread ` and `kNumRandomStates `.  
   Based on https://github.com/apache/incubator-mxnet/blob/master/src/operator/random/sampler.h#L54-L55: 
   ```
   num_thread = min(num_elements/min_num_rand_per_thread, num_random_states)
   ```
   
   Currently these values are fixed, which is not idle depending on the size of the tensor to generate. For large tensors, increasing `kNumRandomStates` / reducing `kMinNumRandomPerThread` may help. However, increasing `kNumRandomStates` leads to higher gpu memory usage, while reducing `kMinNumRandomPerThread` may lead to higher scheduling overhead. This PR makes these variables configurable via env vars.
   
   
   ## 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](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 ###
   - [ ] 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
   

----------------------------------------------------------------
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