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 2017/12/02 22:04:08 UTC

[GitHub] eric-haibin-lin opened a new pull request #8922: fix a bug in sparse batch loader when batch size is extremely large

eric-haibin-lin opened a new pull request #8922: fix a bug in sparse batch loader when batch size is extremely large
URL: https://github.com/apache/incubator-mxnet/pull/8922
 
 
   ## Description ##
   The previous implementation of sparse batch loader waits for the number of data instances reaches `batch_size` before allocating the buffer for copy (unlike dense batch loader, we don't know the actual buffer size to allocate since the number of non-zeros varies). However, such delayed allocate is buggy when batch size is extremely large, because the `DataInst` returned by `base_` is only a reference to the data. By the time copy happens, the referenced data might already be updated by the parser. 
   
   This PR modifies the sparse batch loader to be almost the same as batch loader, except that:
   - data buffer is allocated based on estimation, and adjusted when capacity is not sufficient
   - before returning the output, the shape of tensor has to reflect the actual number of elements in the tensor.
   
   @cjolivier01 @reminisce @anirudh2290  @ZiyueHuang
   
   ## Checklist ##
   ### Essentials ###
   - [ ] Passed code style checking (`make lint`)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage
   - [ ] For user-facing API changes, API doc string has been updated. For new C++ functions in header files, their functionalities and arguments are well-documented. 
   - [ ] To 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