Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

waitforall() hides errors #13234

Closed
samskalicky opened this issue Nov 12, 2018 · 3 comments · Fixed by #14397
Closed

waitforall() hides errors #13234

samskalicky opened this issue Nov 12, 2018 · 3 comments · Fixed by #14397

Comments

@samskalicky
Copy link
Contributor

mx.nd.waitforall() doesnt check for errors and rethrow any that have occurred users will get an error when reading the output data. But I ran into an issue where I was gathering performance data, measuring elapsed time over an inference via model.forward() and mx.nd.waitforall() but I had hit an error and it was being hidden by waitforall(). I would have gotten the error had I actually read the output data, though.

For this issue, we should fix waitforall() to have the ability to check for errors on each of the outputs.

@anirudh2290
Copy link
Member

this is by design and has been documented in the PR: #9681 . The waitforall is generally used for synchronization and benchmarking purposes. If you want to throw the exception you can call wait to read on the variables before or after the waitall call. Adding waitall support requires a global exception ptr and complicates the implementation. To workaround you should read the the output data before or after caliing waitall.

@lupesko
Copy link
Contributor

lupesko commented Nov 13, 2018

@mxnet-label-bot add [Feature Request]

@lupesko
Copy link
Contributor

lupesko commented Nov 13, 2018

@mxnet-label-bot add [NDArray]

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

Successfully merging a pull request may close this issue.

4 participants