mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-mxnet] ptrendx commented on a change in pull request #16790: migrate cudaMemcpy to cudaMemcpyAsync+cudaStreamSynchronize
Date Wed, 13 Nov 2019 17:28:50 GMT
ptrendx commented on a change in pull request #16790: migrate cudaMemcpy to cudaMemcpyAsync+cudaStreamSynchronize
URL: https://github.com/apache/incubator-mxnet/pull/16790#discussion_r345896857
 
 

 ##########
 File path: src/operator/contrib/proposal.cu
 ##########
 @@ -456,9 +459,10 @@ class ProposalGPUOp : public Operator{
     float* workspace_proposals_ptr = NULL;
     FRCNN_CUDA_CHECK(cudaMalloc(&workspace_proposals_ptr, sizeof(float) * count * 5));
     Tensor<xpu, 2> workspace_proposals(workspace_proposals_ptr, Shape2(count, 5));
-    FRCNN_CUDA_CHECK(cudaMemcpy(workspace_proposals.dptr_,
-                                &anchors[0], sizeof(float) * anchors.size(),
-      cudaMemcpyHostToDevice));
+    cudaStream_t stream = mshadow::Stream<gpu>::GetStream(s);
+    FRCNN_CUDA_CHECK(cudaMemcpyAsync(workspace_proposals.dptr_,
 
 Review comment:
   No. The fact that `ProposalGridKernel` runs in default stream is a bug, I agree, but it
is a performance bug, not a correctness one. The semantics of the default stream is that it
synchronizes with all other streams, so there is not a race here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message