-
At the outset, thanks for a very well-structured course. I am coming from tensorflow background and this course is helping me a lot in picking up PyTorch related concepts quickly !! Working with devices in tensorflow is very intuitive and we just have to select device for the session OR specify distributed strategy and things work out of the box. Have two questions related to this.
2a. Why should we choose device for data ? 2b. If we choose GPU:1 for data and and gpu:0 for model (separate devices for model and data), it should introduce latency and will be noticeable for bigger datasets. Why is this option given ? The design should have been that data / model to reside on the same device to speed up things. Sure, I am missing something very trivial. Need your inputs. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ra9hur, Good questions!
This is for maximum customizability of the code. And the ability to choose which device the computation happens on. E.g. some computation may be better on GPU, some better on CPU.
Model + data have to be on the same device for computation to happen. If a model is on GPU and data on CPU, an error will occur (the data isn't stored in the same place).
This is correct. For this, you'll likely want to use libraries that allow multi-GPU usage, such as:
|
Beta Was this translation helpful? Give feedback.
Hi @ra9hur,
Good questions!
This is for maximum customizability of the code.
And the ability to choose which device the computation happens on.
E.g. some computation may be better on GPU, some better on CPU.
Model + data have to be on the same device for computation to happen.
If a model is on GPU and data on CPU, an error will occur (the data isn't stored in the same place).