-
Notifications
You must be signed in to change notification settings - Fork 621
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 an ability to return a duplicated outputs from the DALI pipeline #1556
Conversation
CI MESSAGE: [1024038]: BUILD STARTED |
dali/python/nvidia/dali/pipeline.py
Outdated
for name in outputs: | ||
idx = output_map.get(name, next_free_idx + 1) | ||
if idx > next_free_idx: | ||
output_map[name] = next_free_idx | ||
idx = next_free_idx | ||
next_free_idx += 1 | ||
unique_outputs.append(name) | ||
self._outputs_list.append(idx) |
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 wanted to suggest something that is clearer when indexing, but it does lookup the dictionary twice.
for name in outputs:
if name not in output_map:
output_map[name] = next_free_idx
next_free_idx +=1
unique_outputs.append(name)
self._outputs_list.append(output_map[name])
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.
It is not perf critical. Done.
dali/python/nvidia/dali/pipeline.py
Outdated
pipeline_tls = tls() | ||
|
||
def show_deprecation_warning(deprecated, in_favor_of): |
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.
def show_deprecation_warning(deprecated, in_favor_of): | |
def _show_deprecation_warning(deprecated, in_favor_of): |
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.
Done
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.
Minor nitpick, otherwise ok.
CI MESSAGE: [1024053]: BUILD STARTED |
CI MESSAGE: [1024038]: BUILD FAILED |
CI MESSAGE: [1024053]: BUILD FAILED |
CI MESSAGE: [1024285]: BUILD STARTED |
CI MESSAGE: [1024285]: BUILD FAILED |
CI MESSAGE: [1024302]: BUILD STARTED |
CI MESSAGE: [1024302]: BUILD FAILED |
CI MESSAGE: [1024321]: BUILD STARTED |
CI MESSAGE: [1024323]: BUILD STARTED |
CI MESSAGE: [1024321]: BUILD FAILED |
CI MESSAGE: [1024321]: BUILD PASSED |
CI MESSAGE: [1024323]: BUILD PASSED |
dali/pipeline/pipeline.cc
Outdated
.AddOutput("contiguous_" + name, "cpu"); | ||
PrepareOpSpec(&spec, GetNextInternalLogicalId()); | ||
|
||
graph_.AddOp(spec, "__MakeContiguous_" + name); |
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.
graph_.AddOp(spec, "__MakeContiguous_" + name); | |
graph_.AddOp(spec, "__MakeContiguous_" + name); | |
it->second.has_contiguous = true; |
This should solve the issue without the need for an extra unordererd_set
- and I think it's missing anyway.
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.
Done
CI MESSAGE: [1029963]: BUILD STARTED |
CI MESSAGE: [1030120]: BUILD STARTED |
CI MESSAGE: [1030120]: BUILD FAILED |
CI MESSAGE: [1029963]: BUILD FAILED |
- adds a code that prevents adding "MakeContiguous" multiple times to the output - adds tests for CPU, GPU and Mixed operators outputs that duplicates - some small clean up in used API checker in the Pipeline Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
CI MESSAGE: [1030348]: BUILD STARTED |
CI MESSAGE: [1030348]: BUILD PASSED |
Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com
Why we need this PR?
What happened in this PR?
JIRA TASK: [475]