-
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
Fixes ExternalSource for the GPU #1452
Conversation
!build |
CI MESSAGE: [980233]: BUILD STARTED |
CI MESSAGE: [980233]: BUILD FAILED |
!build |
CI MESSAGE: [981840]: BUILD STARTED |
CI MESSAGE: [981840]: BUILD FAILED |
!build |
CI MESSAGE: [981939]: BUILD STARTED |
CI MESSAGE: [981939]: BUILD PASSED |
dali/test/python/test_pipeline.py
Outdated
super(ExternalSourcePipeline, self).__init__(batch_size, num_threads, device_id) | ||
self.input = ops.ExternalSource(device="gpu") | ||
self.crop = ops.Crop(device="gpu", crop_h=32, crop_w=32, crop_pos_x=0.2, crop_pos_y=0.2) | ||
#self.batch_size = batch_size |
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.
#self.batch_size = batch_size |
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.
Leftover. Done
!build |
CI MESSAGE: [989683]: BUILD STARTED |
CI MESSAGE: [989683]: BUILD PASSED |
DALI_ENFORCE(source != nullptr, "Input name '" + | ||
name + "' is not marked as an external input."); | ||
source->SetDataSource(tl); | ||
OperatorBase *op_ptr = &node.InstantiateOperator(); |
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 this happen before we Build the pipeline? If so, that's weird. I would just access the instance of the node, and require the Pipeline to already be built. But I see that it was already done this way. :(
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.
Are you asking about 163?
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.
And reverted as our test relies on the behavior.
dali/test/python/test_pipeline.py
Outdated
except RuntimeError: | ||
pass | ||
else: | ||
assert False, "ExternalSource should throw" |
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 you use nose.assert_raises
?
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.
Do you somehow check the weird combinations of ExternalSource(device="cpu") that is fed gpu data and vice-versa?
We test CPU data to the GPU in test_external_source_gpu, another way around is not supported yet and probably won't be. I can imagine the only GPU to GPU but this is also not supported. |
!build |
CI MESSAGE: [1003214]: BUILD STARTED |
CI MESSAGE: [1003215]: BUILD STARTED |
CI MESSAGE: [1003230]: BUILD STARTED |
CI MESSAGE: [1003214]: BUILD FAILED |
CI MESSAGE: [1003230]: BUILD FAILED |
CI MESSAGE: [1003215]: BUILD FAILED |
!build |
CI MESSAGE: [1008359]: BUILD STARTED |
!build |
CI MESSAGE: [1008391]: BUILD STARTED |
CI MESSAGE: [1008391]: BUILD PASSED |
dali/test/python/test_pipeline.py
Outdated
iterator = iter(TestIterator(iter_num)) | ||
pipe = IterSetupPipeline(iterator, 3, 0, True) | ||
pipe.build() | ||
assert_raises(RuntimeError, pipe.run) |
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.
seems that this belongs to test_external_source_fail
case
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
- fixes handling of feed_input method when ExternalSource is located in the GPU - updates the ExternalSource example by layout usage - adds a notice that `feed_input` should be called from the inside of `iter_setup` method Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
CI MESSAGE: [1011290]: BUILD STARTED |
CI MESSAGE: [1011290]: BUILD FAILED |
CI MESSAGE: [1011290]: BUILD PASSED |
in the GPU
feed_input
should be called from the inside ofiter_setup
methodSigned-off-by: Janusz Lisiecki jlisiecki@nvidia.com
Why we need this PR?
feed_input
should be called from the inside ofiter_setup
methodWhat happened in this PR?
feed_input
docs and added layout to the exampleJIRA TASK: [NA]