Skip to content
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

regression test failure on macos intel runs #1713

Closed
chenrui333 opened this issue Dec 17, 2024 · 1 comment
Closed

regression test failure on macos intel runs #1713

chenrui333 opened this issue Dec 17, 2024 · 1 comment

Comments

@chenrui333
Copy link

👋 trying to build the latest release, but run into some regression test issue. The error log is as below:

regression test log
  ==> /usr/bin/clang++ test.cpp -std=c++17 -I/usr/local/Cellar/mlx/0.21.1/include -L/usr/local/Cellar/mlx/0.21.1/lib -lmlx -o test
  ==> ./test
  ==> python3.13 test.py
  Traceback (most recent call last):
    File "/private/tmp/mlx-test-20241207-14040-i4lr7y/test.py", line 3, in <module>
      assert mx.cos(x) == 1.0
             ^^^^^^^^^^^^^^^^
  AssertionError

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/12207413864/job/34063910203?pr=161270
relates to Homebrew/homebrew-core#200351

@awni
Copy link
Member

awni commented Dec 17, 2024

This looks like a testing issue probably exposed by a recent switch to using accelerate for the intel back-end as well:

>>> mx.cos(0.0, stream=mx.cpu).item()
0.9999999403953552

In general I would us mx.allclose rather than test exact match when dealing with floating point numbers. So change your test to:

assert mx.allclose(mx.cos(x), mx.array(1.0))

@awni awni closed this as completed Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants