asadoughi opened a new pull request #12975: Implemented a regression unit test 
for #11793
URL: https://github.com/apache/incubator-mxnet/pull/12975
 
 
   ## Description ##
   When using C++-based iterators, it's important that only a single batch is 
referenced at a time. Because C++ iterators are exposed to the Python code 
through a C API, there is no concept of reference counting. Hence, typically 
C++ iterators will deallocate a batch when next() is called on them. So, we 
need to make sure the Python code only references a single batch at a time, 
otherwise the Python code will attempt to access freed memory, resulting in 
either (a) garbage accuracy or (b) a segmentation fault.
   
   The test passes with the latest mxnet build. I verified it failed on 
previous releases, such as mxnet==1.2.0.
   
   
   ## 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 ###
   - No feature changes.
   
   ## Comments ##
   We encountered an issue with garbage accuracy on an older MXNet release with 
our custom C++ iterators and saw that it was fixed in the latest master, but 
without a regression test. So, here I have implemented such a regression test.
   

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