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

RETURNN frontend with PyTorch: Automatic mixed precision (AMP) support #1311

Closed
albertz opened this issue Apr 13, 2023 · 0 comments
Closed

Comments

@albertz
Copy link
Member

albertz commented Apr 13, 2023

Automatic mixed precision (AMP) in PyTorch, support for the PT engine (#1334, #1322).
We should make sure this properly works with the RETURNN frontend (#1120).

Small things we should take care of:

  • We should avoid specifying the dtype arg for any PyTorch functions, and instead let PyTorch figure out the dtype automatically. Only that way, AMP would be used. A specified dtype would overwrite AMP. Or if we have good reasons to specify the dtype, maybe only do this if AMP is disabled.
  • We should actually follow the dtype which is returned by the PyTorch function, and overwrite the dtype of our Tensor.

That's probably already it?

We should later test this on some common modules.

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

No branches or pull requests

1 participant