Skip to content
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

Remove cuDNN fields from OperatorConf #3536

Merged
merged 2 commits into from
Sep 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions oneflow/core/kernel/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ class KernelIf : public Kernel {
}
}
}

bool EnableCudnn() const { return op_conf().enable_cudnn(); }
};

#define REGISTER_KERNEL(k, KernelType) \
Expand Down
2 changes: 0 additions & 2 deletions oneflow/core/operator/op_conf.proto
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,6 @@ message OperatorConf {
required string name = 1;
optional bool trainable = 3 [default = true];
optional string device_tag = 4 [default = "invalid_device"];
optional bool enable_cudnn = 5;
optional int64 cudnn_buf_limit_mbyte = 6;
repeated string ctrl_in_op_name = 7;
optional int64 scope_symbol_id = 8;
oneof op_type {
Expand Down
14 changes: 0 additions & 14 deletions oneflow/core/operator/operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ void Operator::Init(const OperatorConf& op_conf, const JobDesc* conf_job_desc) {
OperatorConf* this_op_conf = op_attribute_.mutable_op_conf();
*this_op_conf = op_conf;
if (has_job_desc() && job_desc().IsPredict()) { this_op_conf->set_trainable(false); }
if (has_job_desc() && this_op_conf->has_enable_cudnn() == false) {
this_op_conf->set_enable_cudnn(job_desc().EnableCudnn());
}
InitFromOpConf();
}

Expand Down Expand Up @@ -459,17 +456,6 @@ void Operator::VirtualGenKernelConf(
VirtualGenKernelConf(GetBlobDesc4BnInOp, parallel_ctx, kernel_conf);
}

int64_t Operator::cudnn_buf_limit_byte() const {
int64_t cudnn_buf_limit_mbyte = 0;
if (op_conf().has_cudnn_buf_limit_mbyte()) {
cudnn_buf_limit_mbyte = op_conf().cudnn_buf_limit_mbyte();
} else {
CHECK(has_job_desc());
cudnn_buf_limit_mbyte = job_desc().cudnn_buf_limit_mbyte();
}
return cudnn_buf_limit_mbyte * 1024 * 1024;
}

std::string Operator::Bn2ConfName(const std::string& bn) const {
return GetStrValInPbFdOrPbRpf(GetCustomizedConf(), bn);
}
Expand Down
4 changes: 0 additions & 4 deletions oneflow/core/operator/operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class Operator {
// Getters
const std::string& op_name() const { return op_conf().name(); }
DeviceType device_type() const;
bool EnableCudnn() const { return op_conf().enable_cudnn(); }
bool DevIsGpuAndEnableCudnn() const { return device_type() == DeviceType::kGPU && EnableCudnn(); }
const OperatorConf& op_conf() const { return op_attribute_.op_conf(); }
virtual const PbMessage& GetCustomizedConf() const {
UNIMPLEMENTED();
Expand Down Expand Up @@ -242,8 +240,6 @@ class Operator {
MirroredSigInferHint4Ibn,
bool is_mirrored_parallel_view_conf, const ParallelDesc& parallel_desc);

int64_t cudnn_buf_limit_byte() const;

virtual PbMessage* MutableCustomizedKernelConf(KernelConf*) const {
UNIMPLEMENTED();
return nullptr;
Expand Down