Skip to content

Commit 804f7b6

Browse files
authored
Add arm64 binary build (pytorch#52443) (pytorch#52469)
Summary: This is getting tested by pytorch#52441. Adds new config for macos arm64 to our binary builds. Now stores artifacts for mac builds. Pull Request resolved: pytorch#52443 Reviewed By: walterddr Differential Revision: D26517330 Pulled By: janeyx99 fbshipit-source-id: 02774937a827bdd4c08486dc9f8fe63446917f1e
1 parent 32758d3 commit 804f7b6

File tree

4 files changed

+136
-2
lines changed

4 files changed

+136
-2
lines changed

.circleci/cimodel/data/binary_build_data.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ def get_processor_arch_name(gpu_version):
5252
"3.7",
5353
],
5454
)),
55+
macos_arm64=([None], OrderedDict(
56+
wheel=[
57+
"3.8",
58+
],
59+
conda=[
60+
"3.8",
61+
],
62+
)),
5563
# Skip CUDA-9.2 builds on Windows
5664
windows=(
5765
[v for v in dimensions.GPU_VERSIONS if v not in ['cuda92'] + dimensions.ROCM_VERSION_LABELS],

.circleci/cimodel/data/binary_build_definitions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def gen_build_env_list(smoke):
164164
c.find_prop("gpu"),
165165
c.find_prop("package_format"),
166166
[c.find_prop("pyver")],
167-
c.find_prop("smoke"),
167+
c.find_prop("smoke") and not (c.find_prop("os_name") == "macos_arm64"), # don't test arm64
168168
c.find_prop("libtorch_variant"),
169169
c.find_prop("gcc_config_variant"),
170170
c.find_prop("libtorch_config_variant"),
@@ -216,7 +216,9 @@ def get_jobs(toplevel_key, smoke):
216216
configs = gen_build_env_list(smoke)
217217
phase = "build" if toplevel_key == "binarybuilds" else "test"
218218
for build_config in configs:
219-
jobs_list.append(build_config.gen_workflow_job(phase, nightly=True))
219+
# don't test for macos_arm64 as it's cross compiled
220+
if phase != "test" or build_config.os != "macos_arm64":
221+
jobs_list.append(build_config.gen_workflow_job(phase, nightly=True))
220222

221223
return jobs_list
222224

.circleci/config.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,44 @@ jobs:
989989
root: /Users/distiller/project
990990
paths: final_pkgs
991991

992+
- store_artifacts:
993+
path: /Users/distiller/project/final_pkgs
994+
995+
binary_macos_arm64_build:
996+
<<: *binary_mac_params
997+
macos:
998+
xcode: "12.3.0"
999+
steps:
1000+
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
1001+
- checkout
1002+
- run:
1003+
<<: *binary_checkout
1004+
- run:
1005+
<<: *binary_populate_env
1006+
- brew_update
1007+
- run:
1008+
<<: *binary_install_miniconda
1009+
1010+
- run:
1011+
name: Build
1012+
no_output_timeout: "90m"
1013+
command: |
1014+
# Do not set -u here; there is some problem with CircleCI
1015+
# variable expansion with PROMPT_COMMAND
1016+
set -ex -o pipefail
1017+
export CROSS_COMPILE_ARM64=1
1018+
script="/Users/distiller/project/pytorch/.circleci/scripts/binary_macos_build.sh"
1019+
cat "$script"
1020+
source "$script"
1021+
1022+
- persist_to_workspace:
1023+
root: /Users/distiller/project
1024+
paths: final_pkgs
1025+
1026+
- store_artifacts:
1027+
path: /Users/distiller/project/final_pkgs
1028+
1029+
9921030
binary_ios_build:
9931031
<<: *pytorch_ios_params
9941032
macos:
@@ -2858,6 +2896,26 @@ workflows:
28582896
tags:
28592897
only:
28602898
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
2899+
- binary_macos_arm64_build:
2900+
name: binary_macos_arm64_wheel_3_8_cpu_nightly_build
2901+
build_environment: "wheel 3.8 cpu"
2902+
filters:
2903+
branches:
2904+
only:
2905+
- /.*/
2906+
tags:
2907+
only:
2908+
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
2909+
- binary_macos_arm64_build:
2910+
name: binary_macos_arm64_conda_3_8_cpu_nightly_build
2911+
build_environment: "conda 3.8 cpu"
2912+
filters:
2913+
branches:
2914+
only:
2915+
- /.*/
2916+
tags:
2917+
only:
2918+
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
28612919
- binary_windows_build:
28622920
name: binary_windows_wheel_3_6_cpu_nightly_build
28632921
build_environment: "wheel 3.6 cpu"
@@ -5982,6 +6040,34 @@ workflows:
59826040
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
59836041
package_type: libtorch
59846042
upload_subfolder: cpu
6043+
- binary_upload:
6044+
name: binary_macos_arm64_wheel_3_8_cpu_nightly_upload
6045+
context: org-member
6046+
requires:
6047+
- binary_macos_arm64_wheel_3_8_cpu_nightly_build
6048+
filters:
6049+
branches:
6050+
only:
6051+
- nightly
6052+
tags:
6053+
only:
6054+
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
6055+
package_type: wheel
6056+
upload_subfolder: cpu
6057+
- binary_upload:
6058+
name: binary_macos_arm64_conda_3_8_cpu_nightly_upload
6059+
context: org-member
6060+
requires:
6061+
- binary_macos_arm64_conda_3_8_cpu_nightly_build
6062+
filters:
6063+
branches:
6064+
only:
6065+
- nightly
6066+
tags:
6067+
only:
6068+
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
6069+
package_type: conda
6070+
upload_subfolder: cpu
59856071
- binary_upload:
59866072
name: binary_windows_wheel_3_6_cpu_nightly_upload
59876073
context: org-member

.circleci/verbatim-sources/job-specs/binary-job-specs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,44 @@
198198
root: /Users/distiller/project
199199
paths: final_pkgs
200200

201+
- store_artifacts:
202+
path: /Users/distiller/project/final_pkgs
203+
204+
binary_macos_arm64_build:
205+
<<: *binary_mac_params
206+
macos:
207+
xcode: "12.3.0"
208+
steps:
209+
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
210+
- checkout
211+
- run:
212+
<<: *binary_checkout
213+
- run:
214+
<<: *binary_populate_env
215+
- brew_update
216+
- run:
217+
<<: *binary_install_miniconda
218+
219+
- run:
220+
name: Build
221+
no_output_timeout: "90m"
222+
command: |
223+
# Do not set -u here; there is some problem with CircleCI
224+
# variable expansion with PROMPT_COMMAND
225+
set -ex -o pipefail
226+
export CROSS_COMPILE_ARM64=1
227+
script="/Users/distiller/project/pytorch/.circleci/scripts/binary_macos_build.sh"
228+
cat "$script"
229+
source "$script"
230+
231+
- persist_to_workspace:
232+
root: /Users/distiller/project
233+
paths: final_pkgs
234+
235+
- store_artifacts:
236+
path: /Users/distiller/project/final_pkgs
237+
238+
201239
binary_ios_build:
202240
<<: *pytorch_ios_params
203241
macos:

0 commit comments

Comments
 (0)