[CoreML][OSS] Include Core ML in iOS/MacOS nightlies (#65075)
authorTao Xu <taox@fb.com>
Fri, 17 Sep 2021 17:31:18 +0000 (10:31 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 17 Sep 2021 18:27:20 +0000 (11:27 -0700)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65075

Need to drop one line at - https://github.com/pytorch/builder/blob/master/conda/pytorch-nightly/meta.yaml#L65
ghstack-source-id: 138324213

Test Plan:
- Check the iOS nightly builds
  - `pod install LibTorch-Lite-Nightly`

Reviewed By: hanton

Differential Revision: D30912269

fbshipit-source-id: b07679b75ecf89beae2975c37cf17d2449a3304f

.circleci/cimodel/data/simple/nightly_ios.py
.circleci/config.yml
.circleci/scripts/binary_ios_build.sh
.circleci/scripts/binary_macos_build.sh
.circleci/verbatim-sources/build-parameters/pytorch-build-params.yml

index 17c3ad1..e7041a9 100644 (file)
@@ -45,6 +45,7 @@ class IOSNightlyJob:
             props_dict["ios_platform"] = ios_definitions.get_platform(self.variant)
             props_dict["name"] = self.gen_job_name()
             props_dict["use_metal"] = miniutils.quote(str(int(True)))
+            props_dict["use_coreml"] = miniutils.quote(str(int(True)))
 
         template_name = "_".join([
             "binary",
index fdd0aaa..51987dc 100644 (file)
@@ -332,6 +332,9 @@ pytorch_ios_params: &pytorch_ios_params
     lite_interpreter:
       type: string
       default: "1"
+    use_coreml:
+      type: string
+      default: "0"
   environment:
     BUILD_ENVIRONMENT: << parameters.build_environment >>
     IOS_ARCH: << parameters.ios_arch >>
@@ -339,6 +342,7 @@ pytorch_ios_params: &pytorch_ios_params
     SELECTED_OP_LIST: << parameters.op_list >>
     USE_PYTORCH_METAL: << parameters.use_metal >>
     BUILD_LITE_INTERPRETER: << parameters.lite_interpreter >>
+    USE_COREML_DELEGATE: << parameters.use_coreml >>
 
 pytorch_windows_params: &pytorch_windows_params
   parameters:
@@ -7590,6 +7594,7 @@ workflows:
           ios_arch: x86_64
           ios_platform: SIMULATOR
           name: pytorch_ios_12_5_1_nightly_x86_64_build
+          use_coreml: "1"
           use_metal: "1"
       - binary_ios_build:
           build_environment: libtorch-ios-12.5.1-nightly-arm64-build
@@ -7600,6 +7605,7 @@ workflows:
           ios_arch: arm64
           ios_platform: OS
           name: pytorch_ios_12_5_1_nightly_arm64_build
+          use_coreml: "1"
           use_metal: "1"
       - binary_ios_upload:
           build_environment: libtorch-ios-12.5.1-nightly-binary-build-upload
index 30659ad..6c7674e 100644 (file)
@@ -32,9 +32,11 @@ echo "########################################################"
 echo "IOS_ARCH: ${IOS_ARCH}"
 echo "IOS_PLATFORM: ${IOS_PLATFORM}"
 echo "USE_PYTORCH_METAL: ${USE_PYTORCH_METAL}"
+echo "USE_COREML_DELEGATE: ${USE_COREML_DELEGATE}"
 export IOS_ARCH=${IOS_ARCH}
 export IOS_PLATFORM=${IOS_PLATFORM}
 export USE_PYTORCH_METAL=${USE_PYTORCH_METAL}
+export USE_COREML_DELEGATE=${USE_COREML_DELEGATE}
 unbuffer ${PROJ_ROOT}/scripts/build_ios.sh 2>&1 | ts
 
 #store the binary
index c5cdfa9..6519eac 100755 (executable)
@@ -16,6 +16,7 @@ cat >"$build_script" <<EOL
 export PATH="$workdir/miniconda/bin:$PATH"
 if [[ "$CIRCLE_BRANCH" == "nightly" ]]; then
   export USE_PYTORCH_METAL_EXPORT=1
+  export USE_COREML_DELEGATE=1
 fi
 if [[ "$PACKAGE_TYPE" == conda ]]; then
   "$workdir/builder/conda/build_pytorch.sh"
index 6e69932..9d095eb 100644 (file)
@@ -64,6 +64,9 @@ pytorch_ios_params: &pytorch_ios_params
     lite_interpreter:
       type: string
       default: "1"
+    use_coreml:
+      type: string
+      default: "0"
   environment:
     BUILD_ENVIRONMENT: << parameters.build_environment >>
     IOS_ARCH: << parameters.ios_arch >>
@@ -71,6 +74,7 @@ pytorch_ios_params: &pytorch_ios_params
     SELECTED_OP_LIST: << parameters.op_list >>
     USE_PYTORCH_METAL: << parameters.use_metal >>
     BUILD_LITE_INTERPRETER: << parameters.lite_interpreter >>
+    USE_COREML_DELEGATE: << parameters.use_coreml >>
 
 pytorch_windows_params: &pytorch_windows_params
   parameters: