RuntimeError: expected scalar type Float but found Half
See original GitHub issueHi - I’m trying to use the deepspeed plugin with Pytorch Lightning. My code worked before but changing the line in trainer
to add
plugins='deepspeed_stage_3_offload'
Causes the error posted in the title. I’ve tried casting parameters and variables as float and half, but the error persists.
Any suggestions would be much appreciated as I’m really looking forward to see what deepspeed can do.
I should note that the error is happening in a call to a pytorch_geometric
method (if that changes anything).
deepspeed==0.4.3 pytorch-lightning==1.3.8 torch==1.9.0 torch-cluster==1.5.9 torch-geometric==1.7.1 torch-scatter==2.0.7 torch-sparse==0.6.10 torch-spline-conv==1.2.1 torchmetrics==0.3.2 torchvision==0.10.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
RuntimeError: expected scalar type Float but found Half #965
My model exsits a DCN module which compiled by c++. when I use amp.initialize(model, optimizer, opt_level="O1"), RuntimeError has happened( ...
Read more >RuntimeError: Expected object of scalar type Float but got ...
When the error is RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #4 'mat1' , you would...
Read more >expected scalar type Half but found Float" when using fp16
How to fix "RuntimeError: expected scalar type Half but found Float" when using fp16 #10. by TessaCoil - opened Aug 23.
Read more >expected scalar type Float but found Half in deform_conv2d ...
Hi, I have a huge network with some Deformable CNNs (torch.ops.torchvision.deform_conv2d) in it. I am using apex 0.1, Cuda 11, ...
Read more >expected scalar type double but found float - You.com
In short: your data has type double but your model has type float, this is not allowed in pytorch because only data with...
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
No results found
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
@SeanNaren, thanks for helping out the Lightning side. Can you both please keep me in the loop if there any issues to fix on DeepSpeed in order to close this? Thanks!
Closing as this seems to have been fixed on the Lightning side.