CCNet icon indicating copy to clipboard operation
CCNet copied to clipboard

Hope to support mixed-precision training

Open DotWang opened this issue 4 years ago • 2 comments

The function rcca.ca_forward_cuda seems doesn't support mixed-precision training and raise error:

RuntimeError: expected scalar type Float but found Half (data at /data/.conda/envs/pytorch/lib/python3.5/site-packages/torch/include/ATen/core/TensorMethods.h:1821)

when the opt_level of NVIDIA APEX is set to "O1"

While it goes well when I shift opt_level to "O0".

So it should be the reason of data type.

DotWang avatar Aug 12 '20 16:08 DotWang

@DotWang We do not have a plan to make it support mixed-precision training. It will be great if you can achieve it. Maybe there is an alternative way to achieve it. You can replace the Cuda implemented RCCA module with Pytorch pure one.

speedinghzl avatar Aug 17 '20 02:08 speedinghzl

@DotWang We do not have a plan to make it support mixed-precision training. It will be great if you can achieve it. Maybe there is an alternative way to achieve it. You can replace the Cuda implemented RCCA module with Pytorch pure one.

OK, Thank you~

DotWang avatar Aug 17 '20 10:08 DotWang