-
Notifications
You must be signed in to change notification settings - Fork 16
Refactor Windows on ARM build script #193
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
Use the standard repo structure for build.
Hi Mathew, Fixes in the Refactored Code:
|
Thanks - could you check I have made those changes as you intended them? By the way, I think you can make pull request to my branch with the changes directly. |
Hi Mathew, I was going through the bat script and noticed the environment variables are currently being set using inline quotes (e.g., set var="value"), which embeds the quotes inside the variable value. So the actual variable value is like: A safer and more robust approach would be:
This version quotes the values correctly and handles paths with spaces or special characters safely. Thanks! |
Current code correct? |
Yep, looks perfect now.👍 |
@Harishmcw - can you think of a way to avoid leaving behind a modified |
Hi @matthew-brett , To avoid leaving a modified pyproject.toml file, we can create a backup of it. Add this line after ln No.68:
This creates a backup of the original pyproject.toml file as pyproject.toml.bak before any modifications are made. This ensures that we have a copy of the original file. Add this line after ln No.117:
This line restores the original pyproject.toml file from the backup (pyproject.toml.bak). The /Y option automatically confirms the overwrite, ensuring that the original file is restored and no modified version is left behind. Let me know if you need any further clarification or adjustments! Thanks! |
How about the current code? |
Yes, the current code works as expected. However, it does leave behind the pyproject_64_32.toml file after the process. |
I don't see that - I think the |
Ah, you're right — I missed that move command. Thanks for pointing that out, and sorry for the confusion! |
It seems github has opened the windows11-arm64 runners for public repos like this. Want to add a workflow? |
Recording progress here. I've started a @vksukumarx worked out how to install LLVM directly via the installer (see the runner config). The current problem is that the
This is a known problem that will apparently be fixed in the next version of the runner : actions/partner-runner-images#84 I have tried using I have also tried to solve this by installing
but, no matter what directory I try, this always give me:
Someone else ran into the same error on the ARM64 image. There is an open request to install msys2 on the runner but it's not clear whether that will happen. Any other suggestions for a working native CMake welcome. Msys2 might also be a good way to get To make installs easier, I have also asked the team to install actions/partner-runner-images#95 although, as noted there, I have worked out how to do this in a workflow, with considerable experimentation. Suggestions? |
|
a170a34
to
eae33a4
Compare
Thanks - good thought - with that unblocked, I worked through the rest, the build is now passing. My remaining worries are:
|
Add GHA workflow for building on Windows on ARM.
e4a4758
to
6845b50
Compare
Hi @matthew-brett, To clarify:
|
For my own understanding - is this correct? The builds can be 32-bit or 64-bit builds - meaning - binaries for 32-bit for 64-bit architecture. Call this "binary-bits". In e.g. The builds can have 64- or 32-bit API interfaces to BLAS / LAPACK. Call this "API-bits". It doesn't make sense to have binary-bits = 32 and API-bits = 64. Windows on ARM (WoA) effectively only exists in 64-bit binary interface form. The current WoA build script builds binary-bits=64 and API-bits=32. The Is that right? |
I renamed |
Yes, that's correct — the current WoA build script builds with binary-bits = 64 and API-bits = 32 (i.e., INTERFACE64=0). |
Hi, what's the current roadblocks here? |
@mattip - is there anything you are waiting for here? If you agree this is the right approach, it could go in? But is there another tack you would prefer? |
Something seems off with the wheel zipped into the build artifact. I see a single wheel I assume the wheel can be used to build scipy/numpy? I am fine with merging this as-is, it would be nice to provide an win-arm64 wheel with 64-bit interfaces for NumPy, which would enable using larger arrays. |
It also shouldn't be a |
Hi @mattip
|
I committed your change, let's see how it works |
@matthew-brett, @rgommers this looks got to me. Do you want to take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one minor comment. CI log looks as expected (modulo some log pollution from compiler warnings coming from reference LAPACK).
:: First commit containing WoA build fixes. | ||
:: Minimum OpenBLAS commit to build; we'll update to this if commit not | ||
:: present. | ||
set first_woa_buildable_commit="de2380e5a6149706a633322a16a0f66faa5591fc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we in a position to update the submodule OpenBLAS to some commit that contains the WoA build updates as above? Otherwise - what should we do with the noted version if we have to do the update above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at the moment — we'll update the submodule once the SUFFIX64_UNDERSCORE issue is fixed upstream. That way, we produce the correct libname for 64-bit interface builds as scipy_openblas64_.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Harishmcw - yes, we do not use a compatible OpenBLAS at the moment, but the question was whether we could update to one as part of this change. Otherwise, I guess we could cherry-pick the build changes, so that the user would get the right version (e.g. v0.3.29) in terms of execution results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Harishmcw - yes, we do not use a compatible OpenBLAS at the moment, but the question was whether we could update to one as part of this change. Otherwise, I guess we could cherry-pick the build changes, so that the user would get the right version (e.g. v0.3.29) in terms of execution results.
The current OpenBLAS submodule commit we're using already includes all the Win ARM64-related changes, so no update is needed at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Harishmcw - if you look at the code in tools/build_openblas.sh
, you will see that it does git checkout $OPENBLAS_COMMIT
where OPENBLAS_COMMIT
comes from the top of the the windows.yml
and posix.yml
Github workflow files. Currently this commit is v0.3.29
. This is so we can assure ourselves that we are building a specific version, that is constant across the platforms. The WoA build recipe does not do this - but probably should. The problem is the lack of WoA build patches in OpenBLAS v0.3.29 - hence my question above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is fine to change the OPENBLAS_COMMIT
in all the workflow files to a newer commit. Then the version in the pyproject.toml
should be adjusted to match, using `git describe --tags --abbrev=8 in the OpenBLAS directory. I thought I had a test to make sure the result of get_openblas_config() will match the pyproject.toml version, but it seems not. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattip - any preference for the newer (post WoA fixes) commit? Current develop
for example?
And then we can change the logic to error if the OpenBLAS commit doesn't contain the WoA fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any commit is fine, as long as the first fields of the version matches ``git describe --tags --abbrev=8, then tag on a
0` for the wheel version that we can update if there is a problem with the wheel
In general, the replace / copy / move stuff for the 32 vs 64 bit seems like a hack - I mean in the Windows build in general, not just here. Should we have a templated |
Agreed. But this PR follows the pattern of all the others, so it is not a blocker for this PR.
Wait, what? That is the commit used to build OpenBLAS, not |
Use the standard repo structure for build.