Skip to content

MLIR crashes when called from concrete-ml #63729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
irene23dm opened this issue Jul 7, 2023 · 2 comments
Closed

MLIR crashes when called from concrete-ml #63729

irene23dm opened this issue Jul 7, 2023 · 2 comments
Labels
mlir:python MLIR Python bindings

Comments

@irene23dm
Copy link

irene23dm commented Jul 7, 2023

THE ERROR

:~$ python3 prova.py
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libConcretelangBindingsPythonCAPI.so          0x00007f6e7d7f0b91 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 225
1  libConcretelangBindingsPythonCAPI.so          0x00007f6e7d7ee5a4
2  libc.so.6                                     0x00007f6e86003520
3  libConcretelangBindingsPythonCAPI.so          0x00007f6e81bd7652 concrete_optimizer::dag::unparametrized::OperationDag::new::h9a051e100108e97d + 18
4  libConcretelangBindingsPythonCAPI.so          0x00007f6e81bd06aa
5  libConcretelangBindingsPythonCAPI.so          0x00007f6e81bcc9da concrete_optimizer::dag::empty() + 10
6  libConcretelangBindingsPythonCAPI.so          0x00007f6e80e88378
7  libConcretelangBindingsPythonCAPI.so          0x00007f6e80e8a718
8  libConcretelangBindingsPythonCAPI.so          0x00007f6e7d72a452 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 1314
9  libConcretelangBindingsPythonCAPI.so          0x00007f6e7d72aa29 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 361
10 libConcretelangBindingsPythonCAPI.so          0x00007f6e7d72ba33 mlir::detail::OpToOpPassAdaptor::runOnOperationImpl(bool) + 435
11 libConcretelangBindingsPythonCAPI.so          0x00007f6e7d72a146 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 534
12 libConcretelangBindingsPythonCAPI.so          0x00007f6e7d72aa29 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 361
13 libConcretelangBindingsPythonCAPI.so          0x00007f6e7d72b531 mlir::PassManager::run(mlir::Operation*) + 1873
14 libConcretelangBindingsPythonCAPI.so          0x00007f6e7f43e16b mlir::concretelang::pipeline::getFHEContextFromFHE[abi:cxx11](mlir::MLIRContext&, mlir::ModuleOp&, mlir::concretelang::optimizer::Config, std::function<bool (mlir::Pass*)>) + 1211
15 libConcretelangBindingsPythonCAPI.so          0x00007f6e7f4171b0 mlir::concretelang::CompilerEngine::getConcreteOptimizerDescription(mlir::concretelang::CompilerEngine::CompilationResult&) + 352
16 libConcretelangBindingsPythonCAPI.so          0x00007f6e7f4178dd mlir::concretelang::CompilerEngine::determineFHEParameters(mlir::concretelang::CompilerEngine::CompilationResult&) + 669
17 libConcretelangBindingsPythonCAPI.so          0x00007f6e7f41a9d6 mlir::concretelang::CompilerEngine::compile(llvm::SourceMgr&, mlir::concretelang::CompilerEngine::Target, std::optional<std::shared_ptr<mlir::concretelang::CompilerEngine::Library>>) + 2214
18 libConcretelangBindingsPythonCAPI.so          0x00007f6e7f4200ac mlir::concretelang::CompilerEngine::compile(llvm::SourceMgr&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, bool, bool, bool, bool) + 556
19 libConcretelangBindingsPythonCAPI.so          0x00007f6e7d5c284c
20 libConcretelangBindingsPythonCAPI.so          0x00007f6e7d5c501a library_compile(LibrarySupport_Py, char const*, mlir::concretelang::CompilationOptions) + 282
21 _concretelang.cpython-310-x86_64-linux-gnu.so 0x00007f6e7a2b1adc
22 _concretelang.cpython-310-x86_64-linux-gnu.so 0x00007f6e7a291b4d
23 _concretelang.cpython-310-x86_64-linux-gnu.so 0x00007f6e7a278177
24 python3                                       0x000055fe990b3c9e
25 python3                                       0x000055fe990aa72b _PyObject_MakeTpCall + 603
26 python3                                       0x000055fe990c21eb
27 python3                                       0x000055fe990a275a _PyEval_EvalFrameDefault + 25610
28 python3                                       0x000055fe990b44ec _PyFunction_Vectorcall + 124
29 python3                                       0x000055fe9909cc14 _PyEval_EvalFrameDefault + 2244
30 python3                                       0x000055fe990b44ec _PyFunction_Vectorcall + 124
31 python3                                       0x000055fe990a275a _PyEval_EvalFrameDefault + 25610
32 python3                                       0x000055fe990b44ec _PyFunction_Vectorcall + 124
33 python3                                       0x000055fe9909cc14 _PyEval_EvalFrameDefault + 2244
34 python3                                       0x000055fe990a98b4 _PyObject_FastCallDictTstate + 196
35 python3                                       0x000055fe990be184
36 python3                                       0x000055fe990aa6cc _PyObject_MakeTpCall + 508
37 python3                                       0x000055fe990a2b2c _PyEval_EvalFrameDefault + 26588
38 python3                                       0x000055fe990b44ec _PyFunction_Vectorcall + 124
39 python3                                       0x000055fe9909cc14 _PyEval_EvalFrameDefault + 2244
40 python3                                       0x000055fe99099176
41 python3                                       0x000055fe9918ec56 PyEval_EvalCode + 134
42 python3                                       0x000055fe991bbb18
43 python3                                       0x000055fe991b496b
44 python3                                       0x000055fe991bb865
45 python3                                       0x000055fe991bad48 _PyRun_SimpleFileObject + 424
46 python3                                       0x000055fe991baa43 _PyRun_AnyFileObject + 67
47 python3                                       0x000055fe991abc3e Py_RunMain + 702
48 python3                                       0x000055fe99181bcd Py_BytesMain + 45
49 libc.so.6                                     0x00007f6e85fead90
50 libc.so.6                                     0x00007f6e85feae40 __libc_start_main + 128
51 python3                                       0x000055fe99181ac5 _start + 37
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Illegal instruction (core dumped)

THE PYTHON SCRIPT

from concrete import fhe

def add(x, y):
    return x + y

compiler = fhe.Compiler(add, {"x": "encrypted", "y": "clear"})

inputset = [(2, 3), (0, 0), (1, 6), (7, 7), (7, 1)]
circuit = compiler.compile(inputset)

x = 4
y = 4

clear_evaluation = add(x, y)
homomorphic_evaluation = circuit.encrypt_run_decrypt(x, y)

print(x, "+", y, "=", clear_evaluation, "=", homomorphic_evaluation)
@rikhuijzer rikhuijzer added mlir:python MLIR Python bindings and removed new issue labels Jul 24, 2023
@llvmbot
Copy link
Member

llvmbot commented Jul 24, 2023

@llvm/issue-subscribers-mlir-python

@rikhuijzer rikhuijzer changed the title Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it) MLIR crashes when called from concrete-ml Oct 4, 2023
@rikhuijzer
Copy link
Member

Thanks for opening an issue.

I just put the Python script into a file called temp.py and ran the following without problems:

$ python3.10 -m pip install concrete-ml
[...]

$ python3.10 temp.py
4 + 4 = 8 = 8

This worked on an Apple M1 chips and also on a Hetzner Intel (x86).

@irene23dm can you still reproduce the error? If so, could you give more information so that we can reproduce? For example, information about which concrete-ml you are using exactly and what system you are on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:python MLIR Python bindings
Projects
None yet
Development

No branches or pull requests

3 participants