Commit 7fef9aa9 authored by Fenglei's avatar Fenglei Committed by Robert Kimball

gpu convolution asymmetric pad (#1064)

* change convolution to use cudnn emitter

* convolution working

* add asymmetric pad

* forward with asymmetric working

* backward asymmetric

* padding to padding_below

* pad still has bug on backward

* change name

* fix convolution back prop

* fix code block

* slice back from padded output:

* working code

* extra ,

* Update gpu_emitter.cpp

* splict build_convolution to 3 function

* format and fix bugs

* Update cudnn_emitter.hpp
parent 6638e02b
This diff is collapsed.
......@@ -50,11 +50,38 @@ namespace ngraph
public:
enum class Prop
{
Inference,
Inference = 0,
Forward,
Backward
};
size_t build_convolution(const runtime::gpu::GPURuntimeContext* ctx,
const cudnnDataType_t data_type,
const Shape& input_tensor_shape,
const Shape& input_filter_shape,
const Shape& output_tensor_shape,
const Strides& window_movement_strides,
const Strides& window_dilation_strides,
const Shape& padding_below);
size_t build_convolution_backward_data(const runtime::gpu::GPURuntimeContext* ctx,
const cudnnDataType_t data_type,
const Shape& input_filter_shape,
const Shape& input_tensor_shape,
const Shape& output_tensor_shape,
const Strides& window_movement_strides,
const Strides& window_dilation_strides,
const Shape& padding_below);
size_t build_convolution_backward_filter(const runtime::gpu::GPURuntimeContext* ctx,
const cudnnDataType_t data_type,
const Shape& input_tensor_shape_0,
const Shape& input_tensor_shape_1,
const Shape& output_filter_shape,
const Strides& window_movement_strides,
const Strides& window_dilation_strides,
const Shape& padding_below);
size_t build_reduce_forward(const GPURuntimeContext* ctx,
const cudnnReduceTensorOp_t& reduce_op,
const Shape& input_shape,
......@@ -84,6 +111,16 @@ namespace ngraph
const Shape& tensor_shape);
cudnnTensorDescriptor_t& tensor_descriptor_from_shape(const Shape& shape);
cudnnFilterDescriptor_t&
get_cudnn_filter_descriptor(const Shape& shape,
const cudnnDataType_t data_type,
const cudnnTensorFormat_t tensor_format);
cudnnConvolutionDescriptor_t&
get_cudnn_convolution_descriptor(const Shape& padding,
const Strides& window_movement_strides,
const Strides& window_dilation_strides,
cudnnConvolutionMode_t mode,
cudnnDataType_t data_type);
private:
CUDNNEmitter(GPUPrimitiveEmitter* emitter);
......
This diff is collapsed.
......@@ -15,7 +15,6 @@ convolution_2d_1item_1o1i_data_dilated
convolution_2d_1item_2o1i_data_dilated
convolution_2d_1item_2o2i_data_dilated
convolution_2d_1item_5o3i_data_dilated
convolution_2d_1item_padded_2_3x4_5
convolution_2d_2item_5o3i_data_dilated
convolution_2d_2items_dilated_padded
convolution_2d_2items_strided_padded
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment