mlx: [BUG] bus error
Describe the bug
When attempting to run tests, either for C++ or Python I get a generic bus error.
It may as well be a local problem on my machine but it’d be great to rule that out as I’ve tried to re-install from scratch and the problem persists.
To Reproduce
C++:
cd build && make test
Python:
python -m unittest discover python/tests
Expected behavior A clear and concise description of what you expected to happen.
Desktop:
- OS Version: MacOS 14.2.1
- Version: 0.0.7 (currently at 6ea6b42)
Additional context
- Xcode: 15.1
cmake: 3.28.1- Chip: M3 Pro
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Comments: 25 (14 by maintainers)
Thanks @awni, then unless there’s some unlikely difference between M3 Pro and Max I guess this is a local issue. I’ll continue to explore what’s the cause and post any solution in case someone else faces the same problem at some point.
That actually works fine for me.
For reproducibility: I tried compiling via
and
And I always get the correct output when running the python test.
Note: with
mlxI get a bus error not a segmentation fault.There is a simple test case in this thread. Maybe if you have a second you can play around with it and see if it also gives you a bus error. That would strongly suggest something is borked in your environment.
Thanks @gboduljak. I’m admittedly a little stumped by this one. Would be good to check on an M3 Pro to verify that has nothing to do with it… (@jagrit06 might be able to help there).
I am also getting this error. I am working on M2.
FWIW this is what I get when running
make testYes that’s the weird part.
arm64via brew:
/opt/homebrew/bin/cmakeThat works actually! Looks like the problem may be with raising exceptions/throwing errors - the test I pointed out above is the first one to expect an exception.
So the
trilop seems to consistently cause a bus error. I tested it manually and also all the tests up to here work https://github.com/ml-explore/mlx/blob/449b43762e3f970576f054e54066123c0f37246e/python/tests/test_ops.py#L331 this one is the first to cause a bus error (intest_ops.py).Simply running
results in a bus error.