-
Notifications
You must be signed in to change notification settings - Fork 741
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
Add PyTorch macosx-arm64 cross-compiled build #1463
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a3bd375
Add PyTorch macosx-arm64 cross-compiled build
sbrunk 4ca07ee
Improve PyTorch cross-compilation and add Maven profile for CI build
sbrunk 66d9543
Make PyTorch cross-compilation more consistent with numpy and scipy
sbrunk 1673bbb
Fix builds for PyTorch
saudet bda4475
Fix builds for PyTorch some more
saudet bd9d136
Update changelog
sbrunk 6f5cfb0
Merge remote-tracking branch 'upstream/master' into pytorch-macosx-arm64
saudet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,8 @@ | |
<buildResource>/${javacpp.platform.library.path}/</buildResource> | ||
<buildResource>/org/bytedeco/openblas/${javacpp.platform}/</buildResource> | ||
<buildResource>/org/bytedeco/cpython/${javacpp.platform}/</buildResource> | ||
<!-- add host cpython for running setup.py when cross-compiling --> | ||
<buildResource>/org/bytedeco/cpython/${os.name}-${os.arch}/</buildResource> | ||
<buildResource>/org/bytedeco/mkldnn/${javacpp.platform}/</buildResource> | ||
<buildResource>/org/bytedeco/numpy/${javacpp.platform}/</buildResource> | ||
</buildResources> | ||
|
@@ -135,4 +137,45 @@ | |
</plugins> | ||
</build> | ||
|
||
<!-- cross-compilation profile for macosx-arm64 builds on macosx-x86_64 CI machines --> | ||
<profiles> | ||
<profile> | ||
<id>pytorch-cross-compile</id> | ||
<activation> | ||
<property> | ||
<name>javacpp.platform</name> | ||
<value>macosx-arm64</value> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>javacpp</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>cpython</artifactId> | ||
<version>3.12.1-${project.parent.version}</version> | ||
<classifier>${os.name}-${os.arch}</classifier> | ||
</dependency> | ||
<!-- we need to exclude target cpython until we have a macosx-arm64 build --> | ||
<dependency> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>numpy-platform</artifactId> | ||
<version>1.26.3-${project.parent.version}</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose we need to do something similar in platform/pom.xml:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I don't think we need to include those optional dependencies at all... |
||
<exclusions> | ||
<exclusion> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>cpython</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please remove the
if [[ $PLATFORM == $PLATFORM_HOST ]]; then
and do something like this instead: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.
fails (stopping the script) in the cross-compilation setting since
PYTHON_LIB_PATH
is not set at all in that case right now without arm cpython, that's why I put the whole block in a conditional.The same is true i.e. for
since the
PYTHON_INSTALL_PATH
is not set.But I think see the issue, it would break if we wanted to use both host and target cpython right?
What if we test for
PYTHON_BIN_PATH
to exist before running pip install?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.
Right, so instead of all that, let's simply put
CPYTHON_PATH=CPYTHON_HOST_PATH
beforeif [[ -f "$CPYTHON_PATH/include/python3.12/Python.h" ]]; then