diff --git a/lib/Dialect/Torch/Transforms/FuseQuantizedOps.cpp b/lib/Dialect/Torch/Transforms/FuseQuantizedOps.cpp index 7e52ea116..535c2831b 100644 --- a/lib/Dialect/Torch/Transforms/FuseQuantizedOps.cpp +++ b/lib/Dialect/Torch/Transforms/FuseQuantizedOps.cpp @@ -63,6 +63,15 @@ public: llvm::SmallVector operands(op->getOperands()); bool dequanted = false; + // Prevent fusion for 1d convolution ops and just do it as an f32 conv since + // there isn't a linalg named op for quantized 1-d convolution yet. + // TODO: Remove this and add support for 1-d quantized convolution. + int64_t inputRank = + cast(operands[0].getType()).getSizes().size(); + if (isa(op) && inputRank < 4) + return rewriter.notifyMatchFailure( + op, "1-d quantized convolution is not supported"); + for (unsigned i : QuantInfo::operandsToQuantize) { Value operand = operands[i]; std::stack commutingOpStack;