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
Make PyTorch partially cross-compilable for Apple M1 #49701
Conversation
💊 CI failures summary and remediationsAs of commit d657a07 (more details on the Dr. CI page):
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. This comment has been revised 11 times. |
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.
@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Introduce changes similar to pytorch/cpuinfo#51 to detect that PyTorch is build on MacOS for different architecture Test Plan: Pull shibatch/sleef#376 and run `cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DUSE_NNPACK=NO -DUSE_XNNPACK=NO -DBUILD_TEST=YES .. -G Ninja; ninja basic`
5793a94
to
d657a07
Compare
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.
@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@@ -41,7 +41,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") | |||
ENDIF (OMAP4_TRUE) | |||
|
|||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") | |||
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") | |||
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND NOT CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64") |
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.
Do we have to worry about CMAKE_OSX_ARCHITECTURES equalling any other architecture or nah?
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.
In theory we should, but let's do it one step at a time: so far we can only use the system to cross-build it for another platform.
Summary: Update CPUINFO to include pytorch/cpuinfo#51 Update sleef to include shibatch/sleef#376 Modify aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt to recognize CMAKE_OSX_ARCHITECTURES Pull Request resolved: pytorch#49701 Test Plan: `cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DUSE_XNNPACK=NO -DBUILD_TEST=YES .. -G Ninja; ninja basic` finishes successfully on Apple M1 Reviewed By: janeyx99 Differential Revision: D25669219 Pulled By: malfet fbshipit-source-id: 5ee36b64e3a7ac76448f2a300ac4993375a26de5
Update CPUINFO to include pytorch/cpuinfo#51
Update sleef to include shibatch/sleef#376
Modify aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt to recognize CMAKE_OSX_ARCHITECTURES
Test Plan:
cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DUSE_XNNPACK=NO -DBUILD_TEST=YES .. -G Ninja; ninja basic
finishes successfully on Apple M1