dmlc-core icon indicating copy to clipboard operation
dmlc-core copied to clipboard

Shuffle in groups for IndexedRecordIO

Open ptrendx opened this issue 7 years ago • 4 comments

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

ptrendx avatar Oct 18 '17 17:10 ptrendx

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.

ptrendx avatar Oct 18 '17 22:10 ptrendx

@piiswrong @zhreshold Do you have any other comments?

ptrendx avatar Oct 20 '17 17:10 ptrendx

I'm good with the modification.

zhreshold avatar Oct 20 '17 18:10 zhreshold

@piiswrong merge this?

tqchen avatar Nov 29 '17 19:11 tqchen

Closing, as the pull request has been stable. Feel free to re-submit if the change is still necessary. Thanks!

hcho3 avatar Aug 08 '23 19:08 hcho3