mirror of https://github.com/llvm/torch-mlir
[Torch] Disable 1-d quantized convolution (#3601)
To fix https://github.com/nod-ai/SHARK-Turbine/issues/253#issuecomment-2271815640 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. Get 24 onnx eca* models passed in iree-comiple.pull/3607/head
parent
2d6bfb2dec
commit
a51b4e014a
|
@ -63,6 +63,15 @@ public:
|
|||
llvm::SmallVector<Value> 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<ValueTensorType>(operands[0].getType()).getSizes().size();
|
||||
if (isa<Torch::AtenConvolutionOp>(op) && inputRank < 4)
|
||||
return rewriter.notifyMatchFailure(
|
||||
op, "1-d quantized convolution is not supported");
|
||||
|
||||
for (unsigned i : QuantInfo<SrcOp>::operandsToQuantize) {
|
||||
Value operand = operands[i];
|
||||
std::stack<mlir::Operation *> commutingOpStack;
|
||||
|
|
Loading…
Reference in New Issue