-
Notifications
You must be signed in to change notification settings - Fork 16
Add MLX tensor adapter with dtype conversion and comprehensive tests #271
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
❌ 4 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
|
@copilot install mlx only when platform is not Windows. Skip the tests on Windows because mlx is not available. |
- Add mlx to requirements-dev.txt with sys_platform != "win32" condition - Update skip_if_no decorator to skip MLX tests on Windows - Improve error handling in skip_if_no for missing parent modules Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
MLX is now installed only on non-Windows platforms via |
Implements tensor adapter for MLX arrays following the established TorchTensor pattern.
Implementation
MlxArrayclass: Wraps MLX arrays to implement TensorProtocolnumpy(): Converts vianp.from_dlpack()for efficient zero-copy transfertobytes(),tofile(): Standard serialization methods__array__(): NumPy protocol supportDtype conversion:
from_mlx_dtype()/to_mlx_dtype()Test infrastructure: Enhanced
skip_if_no()to handle import failures and platform checksPlatform-specific installation: MLX only installed on non-Windows platforms via
mlx; sys_platform != "win32"in requirements-dev.txtUsage
66 new tests covering all dtypes and operations. All existing tests pass. Tests gracefully skip on platforms without MLX support.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.