-
Notifications
You must be signed in to change notification settings - Fork 606
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
Better error message when insufficient data in cache #2924
Conversation
!build |
dali/pipeline/executor/executor.cc
Outdated
DALI_FAIL( | ||
make_string("No more batches in cache left. Make sure, that DALI Pipeline is fed with " | ||
"sufficient amount of data. ", e.what())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the cache? I think both errors should go to the same bag - the user hasn't provided enough data.
CI MESSAGE: [2337017]: BUILD STARTED |
!build |
CI MESSAGE: [2337023]: BUILD STARTED |
CI MESSAGE: [2337023]: BUILD FAILED |
dali/pipeline/executor/executor.cc
Outdated
for (auto &bsp : bsps) { | ||
bsp->Advance(); | ||
} | ||
} catch (const std::exception &e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's dirty to catch a generic exception and assume its meaning. There should be a better error resolution upstream (preferred) or better inspection here (passable, but still ugly). The way it is, we can produce truly ridiculous errors here, like:
"Failed to acquire the next batch. Make sure, that DALI Pipeline is fed with sufficient amount of data. Bad alloc."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding specialized exception to batch_size_provider.h
? NextBatchSize
and Advance
could throw this one then
struct cache_empty : std::out_of_range {};
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's necessary. However, we already throw out_of_range
and we could catch that. This at least eliminates everything else we could possibly catch here.
} catch (const std::exception &e) { | |
} catch (const std::out_of_range &e) { |
make_string("Failed to acquire the next batch. Make sure, that DALI Pipeline is fed " | ||
"with sufficient amount of data. ", e.what())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a name of the offending node here? If the node was populated with feed_input
, we'll have the name of the very source the user failed to feed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually the name is generated and doesn't tell much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for external_source that's manually fed with feed_input
, usually by name (like in Triton) - and for others it would at least be "ExternalSource_" and that index would most likely correspond to the ordinal of the external source in order of operator instantiation.
!build |
CI MESSAGE: [2340802]: BUILD STARTED |
CI MESSAGE: [2340802]: BUILD FAILED |
!build |
CI MESSAGE: [2340851]: BUILD STARTED |
CI MESSAGE: [2340851]: BUILD PASSED |
Signed-off-by: Michał Szołucha mszolucha@nvidia.com
Why we need this PR?
Pick one, remove the rest
This PR adds better error message, when DALI fails on the situation, that there's not enough data in external_source's cache
What happened in this PR?
Fill relevant points, put NA otherwise. Replace anything inside []
try-catch block
executor
NA
NA
NA
JIRA TASK: [Use DALI-XXXX or NA]