Recall & Review
beginner
What is DataParallel in PyTorch?
DataParallel is a PyTorch feature that helps run a model on multiple GPUs by splitting input data across them and combining results automatically.
Click to reveal answer
beginner
How does DataParallel split the input data?
DataParallel splits the input batch into smaller chunks, sending each chunk to a different GPU to process in parallel.
Click to reveal answer
beginner
What happens to the model outputs in DataParallel?
After each GPU processes its chunk, DataParallel gathers all outputs and combines them into a single output on the main GPU.
Click to reveal answer
beginner
How do you wrap a PyTorch model with DataParallel?
You wrap your model by calling
model = torch.nn.DataParallel(model). This enables multi-GPU usage automatically.Click to reveal answer
intermediate
What is a key limitation of DataParallel?
DataParallel uses one main GPU to gather results, which can create a bottleneck and limit scaling to many GPUs.
Click to reveal answer
What does DataParallel do with input data in PyTorch?
✗ Incorrect
DataParallel splits the input batch across GPUs to run the model in parallel.
How do you enable DataParallel for a model in PyTorch?
✗ Incorrect
The correct syntax is torch.nn.DataParallel(model) to wrap the model.
Where does DataParallel gather the outputs from multiple GPUs?
✗ Incorrect
DataParallel collects outputs on the main GPU to combine them.
What is a downside of using DataParallel?
✗ Incorrect
The main GPU gathers outputs, which can slow down scaling.
Which PyTorch module provides DataParallel?
✗ Incorrect
DataParallel is part of torch.nn module.
Explain how DataParallel works in PyTorch to use multiple GPUs.
Think about how data and results move between GPUs.
You got /4 concepts.
Describe one advantage and one limitation of using DataParallel.
Consider what makes it simple and what slows it down.
You got /2 concepts.