Can we move the data_preprocessor to dataset instead of model? #637
Replies: 3 comments 7 replies
-
Hi @shenmishajing ,
|
Beta Was this translation helpful? Give feedback.
-
Two more points:
|
Beta Was this translation helpful? Give feedback.
-
Have you tested the data transfer time? I tried it on A100 with 256 batch size and the transfer time is only about several milliseconds. |
Beta Was this translation helpful? Give feedback.
-
Now, the data_preprocessor is a part of model which can transfer the data to the correct device automatically. Absolutely, it's a smart idea. But, it has a few of disadvantages.
In fact, if we put the data_preprocessor in dataset (or dataloader), we can use pre fetch techinque to hide the transfer time behind the compute time to reduce it's effect. For more detail, see https://www.zhihu.com/question/307282137/answer/1518052588
Beta Was this translation helpful? Give feedback.
All reactions