DALI icon indicating copy to clipboard operation
DALI copied to clipboard

external_source_test may has a bug

Open tendar opened this issue 2 years ago • 2 comments

Hi, external_source_test may has a bug. The test file is https://github.com/NVIDIA/DALI/blob/main/dali/pipeline/operator/builtin/external_source_test.cc#L181

I think this test may has two place to fix.

The first place is L181: tl_gpu_.Copy(tensor_list) is called batch_size times. In fact is should be called only once, so this code should move out of the two for cycle.

And the second place is L184: src_op->SetDataSource(tl_gpu_, cudaStream_t(0)). Is this code a async call ?, If it is, I think we should call CUDA_CALL(cudaStreamSynchronize(0)) again. Because in line 327 FeedWithGpuList is called many times continuely, this may cause new data overlap the old data.

tendar avatar Aug 10 '22 08:08 tendar

In other words, the second place is that CUDA_CALL(cudaStreamSynchronize(0)) should move to beind of src_op->SetDataSource(tl_gpu_, cudaStream_t(0)), not before the code of src_op->SetDataSource(tl_gpu_, cudaStream_t(0)).

tendar avatar Aug 10 '22 08:08 tendar

Hi @tendar . Thanks for reporting this. I think you are right. I have filed a PR (https://github.com/NVIDIA/DALI/pull/4153) to address those two issues.

jantonguirao avatar Aug 10 '22 13:08 jantonguirao