Bump nanobind to 2.2 (#1461)

* bump nanobind

* extension version for tests
This commit is contained in:
Awni Hannun 2024-10-07 16:52:40 -07:00 committed by GitHub
parent 0070e1db40
commit f374b6ca4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 17 additions and 10 deletions

View File

@ -31,7 +31,7 @@ jobs:
name: Install dependencies
command: |
pip install --upgrade cmake
pip install nanobind==2.1.0
pip install nanobind==2.2.0
pip install numpy
sudo apt-get update
sudo apt-get install libblas-dev liblapack-dev liblapacke-dev
@ -83,7 +83,7 @@ jobs:
source env/bin/activate
pip install --upgrade pip
pip install --upgrade cmake
pip install nanobind==2.1.0
pip install nanobind==2.2.0
pip install numpy
pip install torch
pip install tensorflow
@ -172,7 +172,7 @@ jobs:
source env/bin/activate
pip install --upgrade pip
pip install --upgrade cmake
pip install nanobind==2.1.0
pip install nanobind==2.2.0
pip install --upgrade setuptools
pip install numpy
pip install twine
@ -237,7 +237,7 @@ jobs:
source env/bin/activate
pip install --upgrade pip
pip install --upgrade cmake
pip install nanobind==2.1.0
pip install nanobind==2.2.0
pip install --upgrade setuptools
pip install numpy
pip install auditwheel

View File

@ -2,7 +2,7 @@
requires = [
"setuptools>=42",
"cmake>=3.24",
"mlx>=0.17.0",
"nanobind==2.1.0",
"mlx>=0.18.0",
"nanobind==2.2.0",
]
build-backend = "setuptools.build_meta"

View File

@ -1,4 +1,4 @@
setuptools>=42
cmake>=3.24
mlx>=0.17.0
nanobind==2.1.0
mlx>=0.18.0
nanobind==2.2.0

View File

@ -1,7 +1,7 @@
[build-system]
requires = [
"setuptools>=42",
"nanobind==2.1.0",
"nanobind==2.2.0",
"cmake>=3.24",
]
build-backend = "setuptools.build_meta"

View File

@ -688,6 +688,13 @@ class TestArray(mlx_tests.MLXTestCase):
self.assertEqual(b_npy.dtype, np_dtype)
def test_array_from_noncontiguous_np(self):
for t in [np.int8, np.int32, np.float16, np.float32, np.complex64]:
np_arr = np.random.uniform(size=(10, 10)).astype(np.complex64)
np_arr = np_arr.T
mx_arr = mx.array(np_arr)
self.assertTrue(mx.array_equal(np_arr, mx_arr))
def test_array_np_shape_dim_check(self):
a_npy = np.empty(2**31, dtype=np.bool_)
with self.assertRaises(ValueError) as e:

View File

@ -176,7 +176,7 @@ if __name__ == "__main__":
include_package_data=True,
extras_require={
"dev": [
"nanobind==2.1.0",
"nanobind==2.2.0",
"numpy",
"pre-commit",
"setuptools>=42",