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

Using float 16 in training? #6

Open
sanjayss34 opened this issue Oct 30, 2020 · 2 comments
Open

Using float 16 in training? #6

sanjayss34 opened this issue Oct 30, 2020 · 2 comments

Comments

@sanjayss34
Copy link

I've noticed that in training some tensors are of the float 16 datatype, whereas in validation, I only see float 32. is that in line with what you see? Is this intentional? I haven't found the part of the code that causes the float 16 conversion; if there is some conversion like that, could you please point me to where it is in the code?

@tscholak
Copy link
Contributor

tscholak commented Nov 1, 2020

Hi @sanjayss34, we are using Pytorch’s automatic mixed precision mode, which was introduced in 1.6 and originates from NVidia’s own APEX project. I recommend you read up on it here: https://pytorch.org/docs/stable/amp.html

@tscholak
Copy link
Contributor

tscholak commented Nov 1, 2020

with regards to where and how the automatic mixed precision is implemented in duorat, please have a look at the training loop, specifically, around here: https://github.com/ElementAI/duorat/blob/master/scripts/train.py#L275

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

2 participants