Skip to content

Instantly share code, notes, and snippets.

@hodgestar
Last active November 12, 2021 11:48
Show Gist options
  • Save hodgestar/d9e75d369b943a487bc7e2953b4b2ca2 to your computer and use it in GitHub Desktop.
Save hodgestar/d9e75d369b943a487bc7e2953b4b2ca2 to your computer and use it in GitHub Desktop.
Numpy 1.21.2 np.exp breaking np.linalg.solve on CPUs with AVX512
# On a CPU with AVX512 extensions and numpy 1.21.2:
# (only tested on Ubuntu)
import numpy as np
a = np.diag([1+0j, 1])
# commenting out the line below makes everything work, with it det returns a nan.
# breakpoint()
np.exp(0)
x = np.linalg.det(a)
np.testing.assert_allclose(x, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment