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

Add an option to disable Trainer.detect_nan_tensors #1392

Closed
quinor opened this issue Apr 6, 2020 · 5 comments · Fixed by #1475
Closed

Add an option to disable Trainer.detect_nan_tensors #1392

quinor opened this issue Apr 6, 2020 · 5 comments · Fixed by #1475
Assignees
Labels
feature Is an improvement or enhancement help wanted Open to be worked on

Comments

@quinor
Copy link
Contributor

quinor commented Apr 6, 2020

🚀 Feature

Add an option to disable Trainer.detect_nan_tensors

Motivation

This function tends to be pretty slow when your network has got a lot of parameters, especially in small tensors. For example in my case it took ~0.5s per training iteration.

Pitch

Add an option to the Trainer class that disables calling detect_nan_tensors every epoch.

Alternatives

Remove it all together. Bad idea.

Additional context

@quinor quinor added feature Is an improvement or enhancement help wanted Open to be worked on labels Apr 6, 2020
@quinor
Copy link
Contributor Author

quinor commented Apr 6, 2020

I'm currently using a workaround:

trainer.detect_nan_tensors = lambda x: 0

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2020

Hi! thanks for your contribution!, great first issue!

@ethanwharris
Copy link
Member

This proposal sounds good :) would maybe go as far as to say that it should be disabled by default, certainly if this speeds up testing :). We should also add detect_nan_tensors to the profiler so that users can see how long it is taking

@Borda
Copy link
Member

Borda commented Apr 13, 2020

See profiler results here #1354 (comment)

@williamFalcon
Copy link
Contributor

agreed! let's do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants