mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-01 04:24:36 +08:00
Make MLX build on x64 macOS (#901)
The arm64 macbook pros are heavy and I usually care my intel one for mobile, it would be nice if I can play with MLX on it. To build with x64, user must pass `MLX_ENABLE_X64_MAC` to cmake: CMAKE_ARGS='-DMLX_ENABLE_X64_MAC=ON' python setup.py
This commit is contained in:
@@ -11,8 +11,8 @@ import numpy as np
|
||||
|
||||
class MLXTestCase(unittest.TestCase):
|
||||
@property
|
||||
def is_linux(self):
|
||||
return platform.system() == "Linux"
|
||||
def is_apple_silicon(self):
|
||||
return platform.machine() == "arm64" and platform.system() == "Darwin"
|
||||
|
||||
def setUp(self):
|
||||
self.default = mx.default_device()
|
||||
|
@@ -62,7 +62,7 @@ class TestFastSDPA(mlx_tests.MLXTestCase):
|
||||
B = 1
|
||||
H = 32
|
||||
dtypes = [np.float32]
|
||||
if not self.is_linux:
|
||||
if self.is_apple_silicon:
|
||||
dtypes.append(np.half)
|
||||
|
||||
for SEQUENCE_LENGTH in [1, 7, 9, 32, 63, 67, 129, 400, 2000]:
|
||||
|
@@ -1772,8 +1772,8 @@ class TestOps(mlx_tests.MLXTestCase):
|
||||
)
|
||||
|
||||
def test_tensordot(self):
|
||||
# No fp16 matmuls on linux
|
||||
if self.is_linux:
|
||||
# No fp16 matmuls on common cpu backend
|
||||
if not self.is_apple_silicon:
|
||||
dtypes = [mx.float32]
|
||||
else:
|
||||
dtypes = [mx.float16, mx.float32]
|
||||
|
Reference in New Issue
Block a user