Skip to content

Commit

Permalink
PerfDB 3D Convolution support (#2505)
Browse files Browse the repository at this point in the history
* more fields and prepped statements
* merge queries and add fields
* remove return by-ref
* fix SQL query error
* add version to .config path and match db field names to driver command line argument names
* add InsertConfig and GetConfig methods for tests
* remove filename change, to be done via new PR
  • Loading branch information
JehandadKhan authored Apr 7, 2020
1 parent cea6064 commit a02171c
Show file tree
Hide file tree
Showing 5 changed files with 264 additions and 172 deletions.
56 changes: 35 additions & 21 deletions src/include/miopen/problem_description.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,35 +111,49 @@ struct ProblemDescription
int group_counts = 0;

static std::string table_name() { return "config"; }
template <class Self, class F>
static void Visit(Self&& self, F f)

template <class Self>
static void Visit(Self&& self, std::function<void(int, std::string)> f)
{
if(!self.direction.IsKnown())
MIOPEN_THROW("!direction.IsKnown()");
f(std::to_string(self.n_inputs), "in_channels");
f(std::to_string(self.in_height), "in_h");
f(std::to_string(self.in_width), "in_w");
f(std::to_string(self.kernel_size_h), "filter_h");
f(std::to_string(self.kernel_size_w), "filter_w");
f(std::to_string(self.n_outputs), "out_channels");
f(std::to_string(self.batch_sz), "batchsize");
f(std::to_string(self.pad_h), "pad_h");
f(std::to_string(self.pad_w), "pad_w");
f(std::to_string(self.kernel_stride_h), "conv_stride_1");
f(std::to_string(self.kernel_stride_w), "conv_stride_0");
f(std::to_string(self.kernel_dilation_h), "dilation_h");
f(std::to_string(self.kernel_dilation_w), "dilation_w");
f(std::to_string(self.bias), "bias");
f("'" + self.in_layout + "'", "layout");
// The column names match the driver command line argument names
f(self.spatial_dims, "spatial_dim");
f(self.n_inputs, "in_channels");
f(self.in_height, "in_h");
f(self.in_width, "in_w");
f(self.in_depth, "in_d");
f(self.kernel_size_h, "fil_h");
f(self.kernel_size_w, "fil_w");
f(self.kernel_size_d, "fil_d");
f(self.n_outputs, "out_channels");
f(self.batch_sz, "batchsize");
f(self.pad_h, "pad_h");
f(self.pad_w, "pad_w");
f(self.pad_d, "pad_d");
f(self.kernel_stride_h, "conv_stride_h");
f(self.kernel_stride_w, "conv_stride_w");
f(self.kernel_stride_d, "conv_stride_d");
f(self.kernel_dilation_h, "dilation_h");
f(self.kernel_dilation_w, "dilation_w");
f(self.kernel_dilation_d, "dilation_d");
f(self.bias, "bias");
f(self.group_counts, "group_count");
}

template <class Self>
static void Visit(Self&& self, std::function<void(std::string, std::string)> f)
{
if(!self.direction.IsKnown())
MIOPEN_THROW("!direction.IsKnown()");
f(self.in_layout, "layout");
std::string data_type =
EncodeDataTypesForKey(self.in_data_type, self.weights_data_type, self.out_data_type);
f("'" + data_type + "'", "data_type");
f(data_type, "data_type");
std::string dir =
self.direction.IsForward() ? "F" : self.direction.IsBackwardData() ? "B" : "W";
f("'" + dir + "'", "direction");
f(std::to_string(self.group_counts), "group_count");
f(dir, "direction");
}

struct Direction
{
public:
Expand Down
Loading

0 comments on commit a02171c

Please sign in to comment.