Skip to content

Use CudnnWorkspaceHandle in exhaustive search#17082

Merged
zhhsplendid merged 4 commits intoPaddlePaddle:developfrom
zhhsplendid:cudnn_workspace
Apr 28, 2019
Merged

Use CudnnWorkspaceHandle in exhaustive search#17082
zhhsplendid merged 4 commits intoPaddlePaddle:developfrom
zhhsplendid:cudnn_workspace

Conversation

@zhhsplendid
Copy link
Member

  1. Use CudnnWorkspaceHandle in exhaustive search of conv_cudnn.
  2. For ops using CudnnWorkspaceHandle in exhaustive search, release their GPU memory after exhaustive search.

test=develop

}
holder_->RunFuncImpl(std::forward<Callback>(cudnn_func),
required_workspace_len);
holder_->ResetWorkspace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The execution of CUDA code is async, so you should call cudaStreamSync before reset workspace.

Copy link
Collaborator

@sneaxiy sneaxiy Apr 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should call this method RunFuncSync? Because this function may be only used when cudnn exhaustive searching, and cudnnFindConvolutionForwardAlgorithmEx is a synchronized method as described in here.

@zhhsplendid Please also add some comments on this method, something like: you have to guarantee that the function is host blocking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chengduoZH Done. I added inside ResetWorkspace() to enforce users to call cudaStreamSynchronize.

@sneaxiy Done

Copy link
Collaborator

@sneaxiy sneaxiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent.

@zhhsplendid zhhsplendid merged commit b949405 into PaddlePaddle:develop Apr 28, 2019
@zhhsplendid zhhsplendid deleted the cudnn_workspace branch May 29, 2019 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants