dmlc-core
dmlc-core copied to clipboard
Shuffle in groups for IndexedRecordIO
@zhreshold
This PR batches images when shuffling images with Indexed RecordIO input split to increase performance of reading from disk. The size of the group is set to 16 by default (tested on RN50, with that group size spinning drive was not a bottleneck for MXNet on 6-core CPU doing simple input pipeline of just decoding, cropping and mirroring) and controlled by new environment variable DMLC_INDEXED_RECORDIO_SHUFFLE_GROUP_SIZE.
I don't think it would make big difference (and user is free to change it to lower value if they want) - the indexed recordio version of shuffle is much "stronger" shuffling than with non-indexed recordio. In the non-indexed case you shuffle images inside chunks of 64 MB after my latest change to MXNet, and 8 MB before that change. 8 MB is ~100 images, so if you had batch size bigger than that you were effectively doing no shuffling at all. So if the training accuracy was ok with non-indexed recordio before, it will not be worse now, even with group size of 16.
@piiswrong @zhreshold Do you have any other comments?
I'm good with the modification.
@piiswrong merge this?
Closing, as the pull request has been stable. Feel free to re-submit if the change is still necessary. Thanks!