torch-mlir icon indicating copy to clipboard operation
torch-mlir copied to clipboard

Lit tests failing with STABLEHLO disabled

Open dbabokin opened this issue 1 year ago • 0 comments

When building with -DTORCH_MLIR_ENABLE_STABLEHLO=OFF and running lit tests, I see three fails:

  TORCH_MLIR :: Conversion/TorchToLinalg/sparse.mlir
  TORCH_MLIR :: Dialect/Torch/invalid.mlir
  TORCH_MLIR :: Dialect/Torch/ops.mlir

All of the fails are due to #sparse_tensor.encoding not being recogined:

bin/torch-mlir-opt < ../test/Conversion/TorchToLinalg/sparse.mlir -split-input-file -verify-diagnostics
module {
}

// -----
within split at <stdin>:3 offset :3:23: error: unexpected error: #"sparse_tensor"<"encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>"> : 'none' attribute created with unregistered dialect. If this is intended, please call allowUnregisteredDialects() on the MLIRContext, or use -allow-unregistered-dialect with the MLIR opt tool used
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
                      ^

#sparse_tensor.encoding was introduced in https://github.com/llvm/torch-mlir/pull/2809 and https://github.com/llvm/torch-mlir/pull/2799 by @aartbik.

The patches have nothing specific to STABLEHLO. I'm wondering if ifdefs for STABLEHLO covering too much code somewhere else.

dbabokin avatar Oct 24 '24 16:10 dbabokin