Skip to content

Fix flaky addmm tests#2581

Merged
zcbenz merged 1 commit intoml-explore:mainfrom
zcbenz:fix-flaky-addmm-test
Sep 10, 2025
Merged

Fix flaky addmm tests#2581
zcbenz merged 1 commit intoml-explore:mainfrom
zcbenz:fix-flaky-addmm-test

Conversation

@zcbenz
Copy link
Copy Markdown
Collaborator

@zcbenz zcbenz commented Sep 10, 2025

It seems that the test is a bit flaky:

======================================================================
FAIL: test_addmm (test_blas.TestBlas.test_addmm)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/circleci/project/python/tests/test_blas.py", line 713, in test_addmm
    self.assertTrue(mx.allclose(expected, out))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: array(False, dtype=bool) is not true

----------------------------------------------------------------------

This PR adds atol=1e-5 which all other addmm tests already did.

Copy link
Copy Markdown
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@zcbenz zcbenz merged commit 52b8384 into ml-explore:main Sep 10, 2025
7 checks passed
@zcbenz zcbenz deleted the fix-flaky-addmm-test branch September 10, 2025 05:22
out = mx.addmm(c, a, b, beta=beta, alpha=alpha)
expected = beta * c + alpha * (a @ b)
self.assertTrue(mx.allclose(expected, out))
self.assertTrue(mx.allclose(expected, out, atol=1e-5))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least the good news is that it is the only flaky test case and it happens a lot, I'll check what is going wrong.

faisalmemon pushed a commit to faisalmemon/mlx that referenced this pull request Oct 30, 2025
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

Successfully merging this pull request may close these issues.

2 participants