Remove useless input shape checker in conv (#19608)

Summary:
The input shape checkers in conv/int8_conv operator is aims to avoid the issue when running with mkldnn winograd, the weigths has to be reordered each time if input shape changed.
However, the checkers result to big performance regression due to frequent reorder.

Meanwhile, in mkldnn-bridge, such case has been already fixed by correcting the prop_kind.
Therefore, we have to remove the useless checker to fix the performance regression.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19608

Differential Revision: D15061169

Pulled By: yinghai

fbshipit-source-id: 649a43ae6fce989e84939210f6dffb143ec3d350
This commit is contained in:
Gu, Jinghui
2019-04-24 11:33:13 -07:00
committed by Facebook Github Bot
parent 87a6974193
commit b675f07bb6
2 changed files with 2 additions and 3 deletions

View File

@ -61,8 +61,7 @@ class IDEEPConvOp : public IDEEPConvPoolOpBase {
}
bool weights_changed = (cached_weights_descriptor_ != filter.get_descriptor());
if (!training_mode_ &&
(weights_changed || (input_changed && algo_ == ialgo::convolution_winograd))) {
if (!training_mode_ && weights_changed) {
op_key_.clear();
cached_weights_descriptor_ = filter.dup_descriptor();
auto filter_in = filter.as_weights();

View File

@ -54,7 +54,7 @@ class IDEEPInt8ConvOp : public IDEEPConvPoolOpBase {
}
bool weights_changed = (cached_weights_descriptor_ != filter.get_descriptor());
if (weights_changed || (input_changed && algo_ == ialgo::convolution_winograd)) {
if (weights_changed) {
op_key_.clear();
cached_weights_descriptor_ = filter.dup_descriptor();
CAFFE_ENFORCE(filter.get_data_type() == idtype::s8 && filter.has_scale());