question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeError: expected scalar type Float but found Half

See original GitHub issue

Hi - 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:closed
  • Created 2 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
tjruwasecommented, Jul 19, 2021

@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!

0reactions
tjruwasecommented, Jul 29, 2021

Closing as this seems to have been fixed on the Lightning side.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found