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

[BUG][MLIR][BERT] examples/torchscript_stablehlo_backend_tinybert.py

Open vasslavich opened this issue 3 months ago • 0 comments

Hello! I've built the project on the commit 71d90788d363e65cadb2a1eee514560932eb29a7. g++/gcc versions are:

(mlir_venv) user@lnx-user:/mnt/big/devzone/torch-mlir$ g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(mlir_venv) user@lnx-user:/mnt/big/devzone/torch-mlir$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Project was built:

$ cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Debug -DPython3_FIND_VIRTUALENV=ONLY -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_EXTERNAL_PROJECTS="torch-mlir" -DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD" -DMLIR_ENABLE_BINDINGS_PYTHON=ON  -DLLVM_TARGETS_TO_BUILD=host externals/llvm-project/llvm -DLIBTORCH_SRC_BUILD=ON -DLIBTORCH_VARIANT=shared -DLLVM_ENABLE_ASSERTIONS=ON  -DCMAKE_C_FLAGS_DEBUG="-g -O0" -DCMAKE_CXX_FLAGS_DEBUG="-g -O0"
# Build everything (including LLVM if in-tree)
cmake --build build

I got a segfault for tinybert example:

(mlir_venv) user@lnx-user:/mnt/big/devzone/torch-mlir$ python projects/pt1/examples/torchscript_stablehlo_backend_tinybert.py
/mnt/big/devzone/torch-mlir/mlir_venv/lib/python3.10/site-packages/transformers/utils/hub.py:124: FutureWarning: Using `TRANSFORMERS_CACHE` is deprecated and will be removed in v5 of Transformers. Use `HF_HOME` instead.
  warnings.warn(
/mnt/big/devzone/torch-mlir/mlir_venv/lib/python3.10/site-packages/transformers/modeling_utils.py:4225: FutureWarning: `_is_quantized_training_enabled` is going to be deprecated in transformers 4.39.0. Please use `model.hf_quantizer.is_trainable` instead
  warnings.warn(
python: /mnt/big/devzone/torch-mlir/externals/llvm-project/mlir/lib/IR/Operation.cpp:624: void checkFoldResultTypes(mlir::Operation*, llvm::SmallVectorImpl<mlir::OpFoldResult>&): Assertion `false && "incorrect fold result type"' failed.
Aborted (core dumped)

================================================================

Maybe does anyone know what the problem is? Could you please share your considerations if so? Thank you in advance!

vasslavich avatar Apr 11 '24 20:04 vasslavich