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/01/13 00:59:54 UTC

[GitHub] DickJC123 opened a new pull request #9409: Random seed setting

DickJC123 opened a new pull request #9409: Random seed setting
URL: https://github.com/apache/incubator-mxnet/pull/9409
 
 
   ## Description ##
   
   I observed failures in "nosetests test_operator_gpu.py:test_random" in the check for repeatable sequences given identical seeds.  These failures are due to a lack of synchronization (i.e. race) between the setting of the seed by the gpu and a subsequent request for random numbers.  The test failures were only occasional and occurred more repeatably on the older, slower GPUs.
   
   The first commit of this PR adds two new tests designed to accentuate the problem.  The test_random.py:test_parallel_random_seed_setting test targets the 'ResourceParallelRandom' that was recently added and fails consistently on multiple generations of GPUs.  The test_random.py:test_random_seed_setting test targets the legacy 'ResourceRandom' and does not exhibit any failures, suggesting the race issue is only present in the new parallel random generator.
   
   The second commit of the PR adds the needed synchronization to ResourceParallelRandom and remedies the failure of the included test.  Since no failure was ever seen in ResourceRandom, I refrained from adding a similar synchronization where none is apparently needed.  I can add such a synchronization blindly if desired.
   
   @piiswrong @szha @yzhliu might have some interest in this PR.
   
   ## Checklist ##
   ### Essentials ###
   - [X] Passed code style checking (`make lint`)
   - [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
   - [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] 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