DickJC123 opened a new pull request #14006: Dual stream cudnn Convolution 
backward() with MXNET_GPU_WORKER_NSTREAMS=2.
URL: https://github.com/apache/incubator-mxnet/pull/14006
 
 
   ## Description ##
   This PR adds a 2nd 'auxiliary' stream to a RunContext and makes it available 
to operators.  This PR includes a modification of the Backward() operation of 
the cudnn implementation of Convolution to run both the dgrad and wgrad kernels 
in parallel, rather than in series.  For large batchsizes (e.g. 256), each of 
these kernels consumes all of a GPU and the training performance improvement is 
negligible.  However, when the per-GPU batchsize is small (e.g. 32, as is 
desirable for fast 'scale out' training that maintains accuracy), the 
performance improvement is in the neighborhood of 2-3%.  More details in a 
follow-up comment.
   
   By default, this PR does not affect the behavior of the framework.  However, 
by setting the environment variable MXNET_GPU_WORKER_NSTREAMS=2, the cudnn 
Convolution backward dgrad and wgrad will be run in separate streams.  The 
resulting speed-up comes with a modest downside- now the kernel workspace areas 
cannot be shared, so the model global memory footprint size grows by 2-3% in 
the case of Resnet50.  This is of no consequence for the main application area 
of this new feature- small batchsize (per GPU) training.
   
   The bottom line is this can be a useful optional knob for users, 
particularly those attempting to duplicate published MLPERF results.  This PR 
includes a test of cudnn vs. no_cudnn Convolution with 
MXNET_GPU_WORKER_NSTREAMS set to both 1 and 2.
   
   ## 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)
   - [C ] 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)
   - [ C] 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:
[email protected]


With regards,
Apache Git Services

Reply via email to