Note: My understanding of cuDNN internals are limited, so if you realize that my question solely stems from wrong udnerstanding, please point it out so I can learn.
These exceptions however always show up in my output window in visual studio and my debugger always breaks at those. I am also wondering about the design choice in general, as there seems to be a cuDNN internal function that does the same job, but probably doesn’t throw any exceptions internally. From the docs:
You can “auto-tune”, that is, iterate over the list and time for each engine config and choose the best one for a particular problem on a particular device. The cuDNN frontend API provides a convenient function, cudnnFindPlan(), which does this.
Is there
a) A reason why choosing the first working config from the list was implemented in this form?
b) A way to hide this exception from showing up in visual studios output window? I like to keep it clean to be able to pinpoint actual errors more quickly
Exception thrown at 0x00007FFA6AC3CF19 in foo.exe: Microsoft C++ exception: cudnn_frontend::cudnnException at memory location 0x00000049E82EE7D0.
it is not very descriptive in itself. With the debugger I could see that it is thrown from pytorch\third_party\cudnn_frontend\include\cudnn_frontend_utils.h in set_error_and_throw_exception which itself is called from pytorch\third_party\cudnn_frontend\include\cudnn_frontend_ExecutionPlan.h in the lines (
Sorry for the delayed response, but for a) my understanding is that this is a historical limitation of cuDNN where the guarantee of a given EngineConfig working after being returned by heuristics is not super strong, and this exception handling until the first working config is found is just a CYA solution (which unfortunately still seems to be needed based on your experience).