-
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 metadata-only inputs. #5635
Conversation
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
CI MESSAGE: [18471715]: BUILD STARTED |
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
CI MESSAGE: [18471967]: BUILD STARTED |
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
CI MESSAGE: [18473499]: BUILD STARTED |
CI MESSAGE: [18471967]: BUILD PASSED |
CI MESSAGE: [18473499]: BUILD PASSED |
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
// If the output order of the operator is `host` then we don't wait for GPU | ||
// inputs - they can't be accessed directly on host and the operator will | ||
// have to issue some sort of synchronization if and when necessary. | ||
// This optimization is essential to avoid oversynchronization | ||
// when the operator needs to access the metadata only (e.g. getting the shape). |
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.
Here we get rid of the dangerous special treatment of GPU inputs to host-ordered operators. The new metadata
flag takes care of the optimization now.
CI MESSAGE: [18504351]: BUILD STARTED |
* Assign a stream to CPU inputs with GPU (non-metadata) inputs * Add Metadata input device - this declares that the input is used for metadata (shape, dtype, etc) access only * Don't synchronize metadata inputs in executor. * Don't prolong the lifetime of metadata-only inputs. * Add InputDevice specifier to random number generators shape_like input. --------- Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
CI MESSAGE: [18504351]: BUILD PASSED |
Category:
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Description:
The bug:
The Copy operator from device to host executed in host order, but the synchronization was skipped.
The solution:
Use a stream for CPU operators with GPU inputs.
Add a special class of metadata-only inputs which do need to wait for the data, so the executor can skip synchronization.
The necessary synchronization happens in the consumers of the copy results (the D2H copy result is a pinned buffer and the copy is asynchronous).
Additional information:
Affected modules and functionalities:
New executor:
Any
input now take aMetadata
inputKey points relevant for the review:
Tests:
Stream assignment tests have been updated.
The
pipeline_test.test_gpu2cpu_conditionals
serves as a bug-fix test.Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A