Skip to content
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

Training with fp16 by DeepSpeed #62

Open
e4exp opened this issue Feb 11, 2021 · 0 comments
Open

Training with fp16 by DeepSpeed #62

e4exp opened this issue Feb 11, 2021 · 0 comments

Comments

@e4exp
Copy link

e4exp commented Feb 11, 2021

Hello, I tried to train linear transformer with fp16 by DeepSpeed, and I got an error saying

RuntimeError: Expected object of scalar type Float but got scalar type Half for argument #2 'mat2' in call to _th_bmm_out

I edited line 67 in fast_transformers.attention.linear_attention to make it work

K = K * key_lengths.float_matrix[:, :, None, None].half()

Obviously, this is bad modification to do.
How can I do when I get these kinds of errors?

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

No branches or pull requests

1 participant