Skip to content

Commit f0d22fc

Browse files
authored
fix sd1.5 with cinn (#64896) (#64921)
1 parent f0a0285 commit f0d22fc

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

paddle/fluid/pir/dialect/operator/interface/layout_transformation.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,8 @@ common::DataLayout PreferLayoutImpl<Conv2dOp>(pir::Operation* op) {
104104
}
105105

106106
template <>
107-
std::vector<pir::Value> RelevantInputsImpl<Conv2dOp>(pir::Operation* op) {
108-
// Note(lyk): We exhibit the layout transformation for filter of conv2d
109-
// due to issues with its infermeta and kernel not functioning
110-
// properly in NHWC layout. However, if the FLAGS_manually_trans_conv_filter
111-
// is enabled, the transfer_layout_pass can also operate correctly.
112-
auto concrete_op = op->dyn_cast<Conv2dOp>();
113-
return {concrete_op.input()};
107+
bool CanBeModifiedImpl<Conv2dOp>(pir::Operation* op) {
108+
return false;
114109
}
115110

116111
template <>

paddle/fluid/pir/dialect/operator/interface/layout_transformation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ OVERLOAD_CAN_BE_MODIFIED(FusedConv2dAddActOp);
109109

110110
class Conv2dOp;
111111
OVERLOAD_PREFER_LAYOUT(Conv2dOp);
112-
OVERLOAD_RELEVANT_INPUTS(Conv2dOp);
112+
OVERLOAD_CAN_BE_MODIFIED(Conv2dOp);
113113
OVERLOAD_REWRITE_BY_LAYOUT(Conv2dOp);
114114

115115
class GroupNormOp;

0 commit comments

Comments
 (0)