-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Feature] Windows support #1513
Comments
I found someone already did some work on this: https://github.com/lighttransport/mlx/commits/lte/ |
Thanks for all the PRs to get this working. I wonder what you think about a good long-term strategy for supporting Windows. We don't have plans to test or optimize regularly for Windows machines. So that might make maintenance a little tricky -> compilation could inadvertently break, performance might be slow, etc. Luckily so far many of the PRs to get windows support have been quite simple (and in some cases improve the quality of the code) so it's not been a difficult decision to merge them. But I'm also wondering about what the right strategy is for PRs which introduce more complexity?e I don't have answers to the above questions.. but maybe a good thing to discuss a bit more while you are in the process of experimenting on Windows. |
I'll add Windows build to node-mlx, so at least the C++ interface will be tested routinely, which is how the x64 mac build is being tested. It is fine if an unsupported build breaks in master and relies on contributors for fixes, most large open source projects I worked with work this way. The key is to leave good comments for the untested code path so maintainers know whether to leave them be or just remove them. For the Windows build of MLX, most changes are already there, with current PRs you can already build a working python extension. Some tests are crashing and need fixes, but I think most of them will not be Windows-specific. The only large change to come is support for |
That all sounds like a good plan. Thanks for your input.
Very cool!
Indeed any underlying bugs exposed in the new compiler/windows we will definitely want to fix. |
With above PRs the C++ tests are passing on Windows, and python tests only have 2 failures left: ======================================================================
FAIL: test_buffer_protocol (test_array.TestArray.test_buffer_protocol)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\cygwin\home\zcbenz\codes\mlx\python\tests\test_array.py", line 1566, in
test_buffer_protocol
self.assertEqual(
AssertionError: 'I' != 'L'
- I
+ L
: mlx.core.uint32<class 'numpy.uint32'>
======================================================================
FAIL: test_multivariate_normal (test_random.TestRandom.test_multivariate_normal)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\cygwin\home\zcbenz\codes\mlx\python\tests\test_random.py", line 200, in
test_multivariate_normal
check_jointly_gaussian(data, mean, cov)
File "C:\cygwin\home\zcbenz\codes\mlx\python\tests\test_random.py", line 177, in
check_jointly_gaussian
self.assertTrue(
AssertionError: array(False, dtype=bool) is not true |
Please take care not to break MinGW in the process of focusing on MSVC. |
@zcbenz If you manage to solve an issue (or stumble on the reason) that caused MLX on Windows hanging on something utterly simple ( |
@stemann Unfortunately I'm not familiar with neither MinGW nor Julia so I can't help directly. Does the C++ tests of MLX pass with MinGW? If not you should probably focus on making the C++ tests pass first, and then try to create a C++ tests case that reproduces the hang, which I can look into. |
Sure - thanks for the quick reply. I’m going to park Windows as broken for the Julia API for the time being. It was also on v0.21.0, so maybe v0.21.1+ will magically make it not hang 🤞😊 |
Validating build on mingw32, and the full plethora of Julia platforms in JuliaPackaging/Yggdrasil#10019 : Windows build is currently broken (due to #1690). |
If anyone fancies taking the (libblastrampoline) MinGW tests and/or examples for a spin, there's a build of the recent
EDIT (2024-12-18 18:34 UTC, below this line):Likely dependencies:
|
I have opened #1720 for tracking the hang on MinGW. |
I tried building MLX on Windows, of course it didn't build but I think it is not very hard to make it work there.
A few problems I met so far:
-DBLAS_LIBRARIES=openblas64/lib/libopenblas.a -DLAPACK_LIBRARIES=openblas64/lib/libopenblas.a -DBLAS_INCLUDE_DIRS=openblas64/include -DLAPACK_INCLUDE_DIRS=openblas64/include
_Complex
butlapack_complex_float
is defined to it.-DMLX_BUILD_GGUF=OFF
.io/load.h
uses unix system calls for IO, I can make it work on Windows by replacing them withstdio.h
equivalents.make_compiled_preamble.sh
needs a Windows version.mx.compile
is going to need many works to find and call MSVC.And there will likely be much more problems since compilations are mostly blocked by
io/load.h
.I don't really like Windows nor enjoy working on it, but the majority of world is using it and I figured out whatever I'm going to work on I would need Windows support to reach wider audience. What do you think?
The text was updated successfully, but these errors were encountered: