anirudh2290 opened a new pull request #11630: Fix flaky test test_deconvolution
URL: https://github.com/apache/incubator-mxnet/pull/11630
 
 
   ## Description ##
   This is to fix the flaky test: 
https://github.com/apache/incubator-mxnet/issues/10973. Prereq PR: 
https://github.com/apache/incubator-mxnet/pull/11470.
   `cublasSgemm` and `cublasDgemm` are currently used for linear algebra 
operations when cudnn is disabled for the Convolution and Deconvolution 
operators. The test_deconvolution test on gpu fails on the input gradients 
comparison for conv and deconv operators. When looking at the failures, the 
difference in the gradients are as big as 0.1. Replacing `cublasSgemm` with 
`cublasSgemmex` while keeping all other code the same, causes the failure to go 
away. Also, the failure doesnt happen on CPU with openblas or MKLDNN or on gpu 
with cudnn enabled. If both APIs work as documented, both cases should have 
seen the failure. My guess is that `cublasSgemm` is doing the conversion of 
float32 to float16 before doing the conversion, causing the precision issues. 
Digging through the cublas documentation, I couldn't find enough information on 
the computation for `cublasSgemm`.
   Please see: http://lutgw1.lunet.edu/cuda/pdf/CUBLAS_Library.pdf  2.8.11 
(cublassgemmex) and 2.7.1 (cublassgemm).
    
   @DickJC123 @ptrendx any inputs on if there should be any difference in 
behavior of two apis when all tensors have float32 dtype.
   
   The important changes are in the file: `src/operator/linalg_impl.h`
   
   
   ## 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)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] 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 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] 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