You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module: cudaRelated to torch.cuda, and CUDA support in generalmodule: error checkingBugs related to incorrect/lacking error checkingmodule: lossProblem is related to loss functiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
I believe I've stumbled upon a slight whoops in nn.CrossEntropyLoss(). If the criterion is called with (a, y) where a in (N, C) and y in (N) such that some yi > C, I get the internal error message below (took a while to parse)... seems like this could use a wrapper. A simple note following the internal error would suffice--how about: "Ensure the class dimension of the predictions matches the class dimension of the targets" ?
There's no way to do that. CUDA doesn't allow adding error messages to asserts, and it's the least invasive way (perf wise) in which we can catch these errors 😕
That's understandable but also horrifying considering "We hope you never spend hours debugging your code because of bad stack traces or asynchronous and opaque execution engines." Not exactly a stack trace, but even harder to parse. Would it make sense to add an option to turn on more expensive logging? Didn't see something like that already in place in the main documentation.
we've thought about this very hard. there is a hard technical limitation in the cuda api on device asserts. However, it is possible that we can try improve a generic error message when device asserts are triggered that roughly covers all asserts. I'll improve this
In software development, one of the most important things are good error messages. UX suffers dramatically when you need to spent hours to find out, you made a relatively stupid user/api error. Also, if performance is more important than UX/DX than Pytorch should introduce a developer/debug mode, where the lib spends a bit more time in generating self explaining and good error messages - if activated. It's really the key to be most efficient and not to waste time.
thanks for your advice. we understand and know what you are saying. as an open source project we are bootstrapped for resources and always have to prioritize things.
if you have time, feel free to improve error messages in pytorch, we even have a list of known bad error messages that need to be improved in #39
Hey, PyTorch is great already--I recently migrated everything over from TensorFlow in half the code and 1/5 the time. I can certainly help write better error messages, but I am a researcher with little to no experience deving on large frameworks. I realize that priorities have to be set--my hope is just that this thread is kept somewhere for eventual consideration, as there's definitely another 2-3X productivity to be squeezed out of debugging time. Seconded that a developer/debug mode should be introduced at some point
I think a generic "device-side assert triggered: perhaps you have an out-of-bounds index? try running on CPU" would be a good first step. Chainer has a full-fledged debug mode that catches OOB and NaNs, but I don't think that provides all that much that running on CPU wouldn't.
module: cudaRelated to torch.cuda, and CUDA support in generalmodule: error checkingBugs related to incorrect/lacking error checkingmodule: lossProblem is related to loss functiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Activity
apaszke commentedon Apr 24, 2017
There's no way to do that. CUDA doesn't allow adding error messages to asserts, and it's the least invasive way (perf wise) in which we can catch these errors 😕
jsuarez5341 commentedon Apr 26, 2017
That's understandable but also horrifying considering "We hope you never spend hours debugging your code because of bad stack traces or asynchronous and opaque execution engines." Not exactly a stack trace, but even harder to parse. Would it make sense to add an option to turn on more expensive logging? Didn't see something like that already in place in the main documentation.
soumith commentedon Apr 26, 2017
we've thought about this very hard. there is a hard technical limitation in the cuda api on device asserts. However, it is possible that we can try improve a generic error message when device asserts are triggered that roughly covers all asserts. I'll improve this
marcj commentedon Apr 26, 2017
In software development, one of the most important things are good error messages. UX suffers dramatically when you need to spent hours to find out, you made a relatively stupid user/api error. Also, if performance is more important than UX/DX than Pytorch should introduce a developer/debug mode, where the lib spends a bit more time in generating self explaining and good error messages - if activated. It's really the key to be most efficient and not to waste time.
soumith commentedon Apr 26, 2017
thanks for your advice. we understand and know what you are saying. as an open source project we are bootstrapped for resources and always have to prioritize things.
if you have time, feel free to improve error messages in pytorch, we even have a list of known bad error messages that need to be improved in #39
jsuarez5341 commentedon Apr 26, 2017
Hey, PyTorch is great already--I recently migrated everything over from TensorFlow in half the code and 1/5 the time. I can certainly help write better error messages, but I am a researcher with little to no experience deving on large frameworks. I realize that priorities have to be set--my hope is just that this thread is kept somewhere for eventual consideration, as there's definitely another 2-3X productivity to be squeezed out of debugging time. Seconded that a developer/debug mode should be introduced at some point
jekbradbury commentedon Apr 27, 2017
I think a generic "device-side assert triggered: perhaps you have an out-of-bounds index? try running on CPU" would be a good first step. Chainer has a full-fledged debug mode that catches OOB and NaNs, but I don't think that provides all that much that running on CPU wouldn't.
1 remaining item
fmassa commentedon Oct 23, 2019
This is being worked on in #26776
Debug improvements (pytorch#1328)
Update third_party/kineto submodule to 185fe9c