Skip to content

Singa 507 _Conv2d and _Pooling2d support odd padding#611

Closed
joddiy wants to merge 87 commits intoapache:masterfrom
joddiy:SINGA-507
Closed

Singa 507 _Conv2d and _Pooling2d support odd padding#611
joddiy wants to merge 87 commits intoapache:masterfrom
joddiy:SINGA-507

Conversation

@joddiy
Copy link
Copy Markdown
Member

@joddiy joddiy commented Feb 28, 2020

Since onnx requests same padding mode, we need to optimize conv and pooling these 2 operators.

FYI:

auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that the output spatial size match the input.In case of odd number add the extra padding at the end for SAME_UPPER and at the beginning for SAME_LOWER. VALID mean no padding.

This JR will finish:

  • lower-level ops(_Conv2d and _Pooling2d) support odd padding mode, for example, if padding is [2,5,2,5], it will crop to a normal padding with [2,2,2,2], and a odd padding with [0,3,0,3]. The odd padding will be added to x tensor firstly and then do normal process with normal padding, then in the backward, the odd padding will be cropped.
  • upper-level ops support four bins padding(i.e., (1,2,1,2,)) and also SAME_UPPER, SAME_LOWER for both 2d and 1d input.
  • For SAME_UPPER, SAME_LOWER, can do shape checking, and if not set shape, can compute the correct shape.
  • Test cases.

shicong and others added 30 commits November 27, 2019 03:26
SINGA-502 Avoid moving data between host and gpu in SoftmaxCrossEntropy
SINGA-476 DNNL(upgrade of MKLDNN) integration and add softmax
@joddiy joddiy closed this Feb 28, 2020
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.

5 participants