-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
140 additions
and
25 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# | ||
# Making wheel for macOS arm64 architecture | ||
# Requirements: | ||
# MacOS Monterey 12.0.0 +, Tensorflow-macos 2.5.0, ARM64 Apple Silicon, Bazel 4.1.0 + | ||
# Please don't install tensorflow-metal, it may cause incorrect GPU devices detection issue. | ||
set -e -x | ||
|
||
# Install CPU version | ||
export TF_NEED_CUDA=0 | ||
|
||
python --version | ||
|
||
python configure.py | ||
|
||
bazel build \ | ||
--cpu=darwin_arm64 \ | ||
--copt -mmacosx-version-min=12.0 \ | ||
--linkopt -mmacosx-version-min=12.0 \ | ||
--noshow_progress \ | ||
--noshow_loading_progress \ | ||
--verbose_failures \ | ||
--test_output=errors \ | ||
build_pip_pkg | ||
|
||
# Output the wheel file to the artifacts directory | ||
bazel-bin/build_pip_pkg artifacts "--plat-name macosx_12_0_arm64 $NIGHTLY_FLAG" | ||
delocate-wheel -w wheelhouse artifacts/*.whl |
File renamed without changes.
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2022 The TensorFlow Recommenders-Addons Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ============================================================================== | ||
""" | ||
Check the system and architecture types | ||
""" | ||
import platform | ||
|
||
|
||
def is_macos(): | ||
return platform.system() == "Darwin" | ||
|
||
|
||
def is_windows(): | ||
return platform.system() == "Windows" | ||
|
||
|
||
def is_linux(): | ||
return platform.system() == "Linux" | ||
|
||
|
||
def is_arm64(): | ||
return platform.machine() == "arm64" | ||
|
||
|
||
def is_raspi_arm(): | ||
return os.uname()[4] == "armv7l" |