mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
Facebook Github Bot
parent
87a6974193
commit
b675f07bb6
@ -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();
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user