Skip to content

fp16 for deform_conv2d missing? #2833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paapu88 opened this issue Oct 19, 2020 · 2 comments · Fixed by #2898
Closed

fp16 for deform_conv2d missing? #2833

paapu88 opened this issue Oct 19, 2020 · 2 comments · Fixed by #2898

Comments

@paapu88
Copy link

paapu88 commented Oct 19, 2020

🐛 Bug

To Reproduce

This example below is copy pasted from https://pytorch.org/docs/stable/torchvision/ops.html
except dtypes are added.
The first part with float32 runs fine, but the second part with float16
produces error:

File "/home/hu-mka/venvs/pytorch/lib/python3.8/site-packages/torchvision/ops/deform_conv.py", line 67, in deform_conv2d
return torch.ops.torchvision.deform_conv2d(
RuntimeError: th_addmm not supported on CPUType for Half

Terveisin, Markus

input = torch.rand(5, 3, 10, 10, dtype=torch.float32)
kh, kw = 3, 3
weight = torch.rand(5, 3, kh, kw, dtype=torch.float32)
offset = torch.rand(5, 2 * kh * kw, 8, 8, dtype=torch.float32)
out = ops.deform_conv2d(input, offset, weight)
print(out)
input = torch.rand(5, 3, 10, 10, dtype=torch.float16)
kh, kw = 3, 3
weight = torch.rand(5, 3, kh, kw, dtype=torch.float16)
offset = torch.rand(5, 2 * kh * kw, 8, 8, dtype=torch.float16)
out = ops.deform_conv2d(input, offset, weight)
print(out)

Environment

(pytorch) hu-mka@humkaLenovo:~/Downloads$ python collect_env.py
Collecting environment information...
PyTorch version: 1.6.0
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.1 LTS (x86_64)
GCC version: (Ubuntu 8.4.0-3ubuntu2) 8.4.0
Clang version: 10.0.0-4ubuntu1
CMake version: version 3.16.3

Python version: 3.8 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: 10.1.105
GPU models and configuration: GPU 0: GeForce GTX 1650 with Max-Q Design
Nvidia driver version: 450.80.02
cuDNN version: Probably one of the following:
/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcudnn.so.7.6.5
/usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.0
[pip3] pytorch-lightning==0.9.0
[pip3] torch==1.6.0
[pip3] torchfunc==0.2.0
[pip3] torchsummary==1.5.1
[pip3] torchvision==0.7.0
[pip3] torchviz==0.0.1
[conda] numpy 1.19.1 pypi_0 pypi

@fmassa
Copy link
Member

fmassa commented Oct 19, 2020

Thanks for opening the issue!

That's correct, for now we don't yet have mixed precision for deform_conv2d, but we should be adding support for it soon (together with the remaining ops that don't support it yet).

@paapu88
Copy link
Author

paapu88 commented Oct 27, 2020

Thank you guys!!! Perfect timing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants