zhreshold opened a new pull request #17464: [WIP][mxnet 2.0] Pure C++ threaded 
dataloader that shared the interface with gluon dataloader
URL: https://github.com/apache/incubator-mxnet/pull/17464
 
 
   ## Description ##
   This is the implementation for proposal 
https://github.com/apache/incubator-mxnet/issues/17269
   
   The coverage for dataset types are still limited but minimal examples are 
already available.
   
   ```python
   import time
   import mxnet as mx
   from mxnet.gluon.data.dataloader import no_mx_iter, DataLoader
   from mxnet.gluon.data.vision.transforms import ToTensor
   
   dataset = mx.gluon.data.vision.CIFAR10()
   cpp_dl = DataLoader(dataset.transform_first(ToTensor()), batch_size=32, 
num_workers=8)
   start = time.time()
   for _ in range(5):
     print(len(cpp_dl))
     for _ in cpp_dl:
       pass
   print('Elapsed time for backend dataloader:', time.time() - start)
   
   with no_mx_iter:
     dl = DataLoader(dataset.transform_first(ToTensor()), batch_size=32, 
num_workers=8)
   start = time.time()
   for _ in range(5):
     print(len(dl))
     for _ in dl:
       pass
   print('Elapsed time for python multiprocess dataloader:', time.time() - 
start)
   ```
   
   C++ backend loader is roughly 2x faster even for a simple workload.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] 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 
https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the best of my 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 to 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