-
Notifications
You must be signed in to change notification settings - Fork 263
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
Use cuDNN routine FindEx to find the best algorithm. #158
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ class CuDNNConvolutionLayer : public ConvolutionLayer<Dtype> { | |
public: | ||
explicit CuDNNConvolutionLayer(const LayerParameter& param) | ||
: ConvolutionLayer<Dtype>(param), handles_setup_(false), | ||
backward_passed_ctr_(0) {} | ||
use_algo_seeker_(true), use_modest_workspace_(true) {} | ||
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom, | ||
const vector<Blob<Dtype>*>& top); | ||
virtual void Reshape(const vector<Blob<Dtype>*>& bottom, | ||
|
@@ -65,7 +65,24 @@ class CuDNNConvolutionLayer : public ConvolutionLayer<Dtype> { | |
size_t *workspace_bwd_data_sizes_; | ||
size_t *workspace_bwd_filter_sizes_; | ||
GPUMemory::Workspace workspace; | ||
int backward_passed_ctr_; | ||
|
||
private: | ||
bool use_algo_seeker_; | ||
bool use_modest_workspace_; | ||
void FindExConvAlgo(const vector<Blob<Dtype>*>& bottom, | ||
const vector<Blob<Dtype>*>& top, | ||
const size_t workspace_bytes); | ||
void GetConvAlgo(const vector<Blob<Dtype>*>& bottom, | ||
const vector<Blob<Dtype>*>& top, | ||
const size_t workspace_bytes); | ||
|
||
vector<cudnnTensorDescriptor_t> cached_bottom_descs_; | ||
vector<cudnnConvolutionDescriptor_t> cached_conv_descs_; | ||
bool IsBottomDescChanged(const vector<Blob<Dtype>*>& bottom); | ||
bool IsConvDescChanged(const vector<Blob<Dtype>*>& bottom); | ||
|
||
bool use_reshape_; | ||
bool initialized_cached_descs_; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO Better: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disagree actually, I like 1 argument / line when they're this long. They should be aligned on the const though ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. But I'll need to sell this to BVLC somehow... :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 89028c4 |
||
#endif | ||
|
||
|
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.
Is this too late to add
use_no_workspace
mode as per our discussion? If so, no problem, we'll add it in next release.