-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental support for if statements in DALI (#4561)
Utilize AutoGraph to capture if statements as a function that gets branches as callables passed as arguments. Trace the code within both branches, detecting the usage of DataNode. Each pipeline has a stack of previously checked conditions and entered branches. Whenever an operator is called within some condition block, its outputs (DataNodes) are registered as produced in this scope. Every time a DataNode is used as input to the operator or touched directly via `ag__.ld` it is looked up in the stack - if was produced on the same level, it is used, otherwise necessary split nodes are inserted. Outputs of both branches are detected by AutoGraph. Non-DataNode results are promoted to CPU constants (so they represent a batch), and results of both branches go into merge node. Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
- Loading branch information
Showing
10 changed files
with
1,179 additions
and
24 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.