-
Notifications
You must be signed in to change notification settings - Fork 615
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 origin stack trace capture for DALI operators #5302
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raise | ||
# We no longer need CurrentModuleFilter here, as we filter whole autograph | ||
import nvidia.dali._conditionals as dc | ||
import nvidia.dali._autograph as ag |
Check notice
Code scanning / CodeQL
Module is imported with 'import' and 'import from' Note
Module 'nvidia.dali._autograph' is imported with both 'import' and 'import from'.
Module '_autograph' is imported with both 'import' and 'import from'.
Module '_autograph' is imported with both 'import' and 'import from'.
klecki
force-pushed
the
origin-stack-trace
branch
from
February 14, 2024 18:42
3a4cc22
to
fe804ae
Compare
klecki
force-pushed
the
origin-stack-trace
branch
from
February 15, 2024 19:41
fe804ae
to
d932983
Compare
Some parts are rewritten in DALI in following commits Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
The solution to stack-trace manipulation in TF was optimized by moving parts of the processing to C++. As we have limited needs for producing traces, it is sufficient to replace them with regulart Python constructs. This steps reenables the construction of StackTraceMapper and Filter in the AG-converted code. It will enable next steps: * we will be capturing origin stack trace for every operator defintion * in conditional mode we will remap it back to the user code from the AG-produced one. Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
klecki
force-pushed
the
origin-stack-trace
branch
from
February 20, 2024 17:40
7b09753
to
1d6f559
Compare
stiepan
reviewed
Feb 28, 2024
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [13153535]: BUILD STARTED |
CI MESSAGE: [13153535]: BUILD FAILED |
CI MESSAGE: [13153535]: BUILD PASSED |
stiepan
approved these changes
Feb 29, 2024
szkarpinski
approved these changes
Feb 29, 2024
klecki
added a commit
to klecki/DALI
that referenced
this pull request
Feb 29, 2024
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
klecki
added a commit
to klecki/DALI
that referenced
this pull request
Feb 29, 2024
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
mzient
reviewed
Mar 4, 2024
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [13262456]: BUILD STARTED |
klecki
added a commit
to klecki/DALI
that referenced
this pull request
Mar 4, 2024
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
mzient
approved these changes
Mar 4, 2024
CI MESSAGE: [13262456]: BUILD PASSED |
18 tasks
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Category: New feature
Description:
Add capture of origin stack trace for DALI operators.
The
extract_stack
collects all frames from the first frame of pipeline definition to the frame with operator invocation (the outermost user API).In regular mode no further processing is needed.
For code that was transformed by AutoGraph, the contents of captured frames are remapped back to the user code, filtered out of the _autograph and _conditionals modules (that contain internal DALI implementation).
Due to how autograph introduces additional frames (for example by implementing if statements with additional function calls), we remove repeated occurrences of the same function, keeping only the last one. AutoGraph's entry point to a function call is used to detect such regions.
Stack traces are collected in OperatorInstance, the outermost layer of the API adds an argument denoting the current stack level, so we can compute how many frames we need to skip related to DALI internals when capturing the stack.
The collected stack is added as hidden arguments to OpSpec. This is backward-compatible for serialized pipelines, as well as allows for disabling and enabling the feature.
As a default the feature is disabled and only available via hidden API.
C++ test operators are extended to work as a loadable plugin based on dummy operator test.
It allows to implement tests for the new feature without extending regular DALI operators.
Follow-up to this PR will utilize this information for providing better error messages - pointing to the origin of error in DALI pipeline definition.
Additional information:
Affected modules and functionalities:
New functionality, extensions for Python API and new hidden arguments in all operators.
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A