cornell-zhang / allo

Allo: A Programming Model for Composable Accelerator Design
https://cornell-zhang.github.io/allo
Apache License 2.0
131 stars 25 forks source link

`python3 -m pytest tests` Aborted (core dumped) #172

Closed zeroherolin closed 1 month ago

zeroherolin commented 2 months ago

I just installed the project and didn't make any changes. When I running python3 -m pytest tests, something gets disturbing. I have reinstalled the whole project, but the result is still the same. I see 'test_linalg.py' & 'test_tensor.py' running into errors.

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

python3 -m pytest tests ============================= test session starts ============================== platform linux -- Python 3.12.4, pytest-8.3.2, pluggy-1.5.0 rootdir: /home/xilinx/allo collected 213 items

tests/ip_integration/test_external.py ..FF.Fs [ 3%] tests/pytorch/test_linear.py . [ 3%] tests/test_bitop.py ......... [ 7%] tests/test_builder.py .............................. [ 22%] tests/test_linalg.py .................................Aborted (core dumped)

python ./tests/test_linalg.py =========================================================================================================================================== test session starts =========================================================================================================================================== platform linux -- Python 3.12.4, pytest-8.3.2, pluggy-1.5.0 rootdir: /home/xilinx/Desktop/allo_dsl/pythonProject collected 35 items

tests/test_linalg.py .................................Fatal Python error: Aborted

Current thread 0x000077ea9bf7b440 (most recent call first): File "/home/xilinx/allo/externals/hcl_mlir/build/tools/hcl/python_packages/hcl_core/hcl_mlir/execution_engine.py", line 20 in lookup File "/home/xilinx/allo/externals/hcl_mlir/build/tools/hcl/python_packages/hcl_core/hcl_mlir/execution_engine.py", line 31 in invoke File "/home/xilinx/allo/allo/backend/llvm.py", line 309 in call File "/home/xilinx/Desktop/allo_dsl/pythonProject/tests/test_linalg.py", line 589 in test_concatenate File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/python.py", line 159 in pytest_pyfunc_call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/python.py", line 1627 in runtest File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 174 in pytest_runtest_call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 242 in File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 341 in from_call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 241 in call_and_report File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 132 in runtestprotocol File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 362 in pytest_runtestloop File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 337 in _main File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 283 in wrap_session File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 330 in pytest_cmdline_main File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/config/init.py", line 175 in main File "/home/xilinx/Desktop/allo_dsl/pythonProject/./tests/test_linalg.py", line 595 in

Extension modules: numpy._core._multiarray_umath, numpy._core._multiarray_tests, numpy.linalg._umath_linalg, yaml._yaml, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.strptime, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.lib, pandas._libs.ops, pandas._libs.hashing, pandas._libs.arrays, pandas._libs.tslib, pandas._libs.sparse, pandas._libs.internals, pandas._libs.indexing, pandas._libs.index, pandas._libs.writers, pandas._libs.join, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.json, pandas._libs.parsers, pandas._libs.testing (total: 53) Aborted (core dumped)

python ./tests/test_tensor.py =========================================================================================================================================== test session starts =========================================================================================================================================== platform linux -- Python 3.12.4, pytest-8.3.2, pluggy-1.5.0 rootdir: /home/xilinx/Desktop/allo_dsl/pythonProject collected 18 items

tests/test_tensor.py ......Fatal Python error: Aborted

Current thread 0x00007955b294a440 (most recent call first): File "/home/xilinx/allo/externals/hcl_mlir/build/tools/hcl/python_packages/hcl_core/hcl_mlir/execution_engine.py", line 20 in lookup File "/home/xilinx/allo/externals/hcl_mlir/build/tools/hcl/python_packages/hcl_core/hcl_mlir/execution_engine.py", line 31 in invoke File "/home/xilinx/allo/allo/backend/llvm.py", line 309 in call File "/home/xilinx/Desktop/allo_dsl/pythonProject/tests/test_tensor.py", line 97 in test_insert File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/python.py", line 159 in pytest_pyfunc_call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/python.py", line 1627 in runtest File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 174 in pytest_runtest_call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 242 in File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 341 in from_call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 241 in call_and_report File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 132 in runtestprotocol File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 362 in pytest_runtestloop File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 337 in _main File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 283 in wrap_session File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/main.py", line 330 in pytest_cmdline_main File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in call File "/home/xilinx/anaconda3/envs/allo/lib/python3.12/site-packages/_pytest/config/init.py", line 175 in main File "/home/xilinx/Desktop/allo_dsl/pythonProject/./tests/test_tensor.py", line 304 in

Extension modules: numpy._core._multiarray_umath, numpy._core._multiarray_tests, numpy.linalg._umath_linalg, yaml._yaml, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.strptime, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.lib, pandas._libs.ops, pandas._libs.hashing, pandas._libs.arrays, pandas._libs.tslib, pandas._libs.sparse, pandas._libs.internals, pandas._libs.indexing, pandas._libs.index, pandas._libs.writers, pandas._libs.join, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.json, pandas._libs.parsers, pandas._libs.testing (total: 53) Aborted (core dumped)

chhzh123 commented 2 months ago

Can you verify if the MLIR dialect and the LLVM match the following commits? Also, did you build everything from source?

zeroherolin commented 2 months ago

Yes I'm sure I have build everything from source.

%7B18EFF6FF-ECA3-4b4b-BAB2-C901659117DD%7D %7B5954E9A4-FEC7-4ce6-82FC-7708707B72C9%7D
zeroherolin commented 2 months ago

I deleted it and then build it from the very begining, stictly as the steps, but things never turned better. Maybe the LLVM repo you specified isn't working as expected. Could you comfirm once more? Btw, so far only 'test_linalg.py' and 'test_tensor.py' ran into errors.

chhzh123 commented 1 month ago

@zeroherolin I rebuilt the Allo project from source but could not reproduce your issue. Please check out this thread. Some possible reasons for this core dump may be the limited memory on your server or some internal issues of the LLVM runtime. In general, it does not impact a lot. You can just skip those test cases and use Allo as usual.

zeroherolin commented 1 month ago

Hello, I run the docker(chhzh123/hcl-dialect:llvm-18.x-py3.12) but run my cmd as follows:

bash build.sh
python3 -m pip install -e .
python3 -m pytest tests

The same error of "Aborted (core dumped)" occured.

chhzh123 commented 1 month ago

@zeroherolin Yeah, this is probably the issue of the MLIR runtime, which depends on the specific machines that run the program, and cannot be reproduced on our server or on the CI. If only test_linalg.py and test_tensor.py failed, you can just skip them.

zeroherolin commented 1 month ago

OK,thanks a lot, and I‘ll close the issue. @chhzh123