Using dask with PyTorch (train a model)
See original GitHub issueI find Dask very useful, and would like to use it to accelerate some pytorch models I am working on. A function to be accelerated would be the forward()
function. I started doing some tests, but I get errors like these:
File "/home/muammar/.local/lib/python3.7/site-packages/distributed/protocol/serialize.py", line 81, in serialization_error_loads
raise TypeError(msg)
TypeError: Could not serialize object of type Tensor.
Traceback (most recent call last):
File "/home/muammar/.local/lib/python3.7/site-packages/distributed/protocol/serialize.py", line 144, in serialize
header, frames = dumps(x, context=context) if wants_context else dumps(x)
File "/home/muammar/.local/lib/python3.7/site-packages/distributed/protocol/serialize.py", line 38, in dask_dumps
header, frames = dumps(x)
File "/home/muammar/.local/lib/python3.7/site-packages/distributed/protocol/torch.py", line 10, in serialize_torch_Tensor
header, frames = serialize(t.numpy())
RuntimeError: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead.
If I detach the variable, then pytorch does not work with numpy arrays. My question would be – what is the state of pytorch support? If it is of any help, I would be more than happy to try any code (or even write something if it is under my capabilities) because it would be very useful to have this support in Dask. Thanks for this great python module.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:48 (43 by maintainers)
Top Results From Across the Web
Training a PyTorch Model across a Dask Cluster | Saturn Cloud
Training a PyTorch model can potentially be sped up dramatically by having the training computations done on multiple GPUs across multiple workers. This...
Read more >PyTorch — dask-ml 2022.5.28 documentation
Skorch allows PyTorch models to be wrapped in Scikit-learn compatible estimators. So, that means that PyTorch models wrapped in Skorch can be used...
Read more >Analyzing Microscopy Images with PyTorch and Dask - Coiled
The Batch Prediction with PyTorch tutorial uses dask.delayed. With dask.delayed, functions aren't executed immediately but lazily. The execution ...
Read more >dask-pytorch-ddp - PyPI
bootstrapping PyTorch workers on top of a Dask cluster · Using distributed data stores (e.g., S3) as normal PyTorch datasets · mechanisms for ......
Read more >Computer Vision at Scale With Dask And PyTorch - KDnuggets
A tutorial on conducting image classification inference using the Resnet50 deep learning model at scale with using GPU clusters on Saturn ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for thinking of us @muammar . Are you able to share the article?
@muammar no objections here! Thank you.