Skip to content
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 Apple Silicon support. #756

Merged
merged 7 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions oss_scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ function is_macos() {
# Remove .bazelrc if it already exist
[ -e .bazelrc ] && rm .bazelrc

if [[ $(pip show tensorflow) == *tensorflow* ]] || [[ $(pip show tf-nightly) == *tf-nightly* ]] ; then
if [[ $(pip show tensorflow) == *tensorflow* ]] ||
[[ $(pip show tensorflow-macos) == *tensorflow-macos* ]] ||
[[ $(pip show tf-nightly) == *tf-nightly* ]]; then
echo 'Using installed tensorflow.'
else
echo 'Installing tensorflow.'
pip install tensorflow==2.7.0rc0
if is_macos; then
sun1638650145 marked this conversation as resolved.
Show resolved Hide resolved
pip install tensorflow-macos
else
pip install tensorflow==2.7.0rc0
fi
fi

if is_windows; then
Expand Down
6 changes: 5 additions & 1 deletion oss_scripts/pip_package/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ function abspath() {

plat_name=""
if is_macos; then
plat_name="--plat-name macosx-10.9-x86_64"
if [[ x"$(arch)" == x"arm64" ]]; then
plat_name="--plat-name macosx_11_0_arm64"
else
plat_name="--plat-name macosx-10.9-x86_64"
fi
fi

main() {
Expand Down
5 changes: 3 additions & 2 deletions oss_scripts/pip_package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ def finalize_options(self):
cmdclass={'install': InstallPlatlib},
distclass=BinaryDistribution,
install_requires=[
'tensorflow>=2.7.0rc0, <2.8',
'tensorflow_hub>=0.8.0',
"tensorflow>=2.7.0rc0, <2.8; platform_system != 'Darwin'",
"tensorflow-macos>=2.6.0, <2.7; platform_system == 'Darwin'",
sun1638650145 marked this conversation as resolved.
Show resolved Hide resolved
"tensorflow_hub>=0.8.0",
sun1638650145 marked this conversation as resolved.
Show resolved Hide resolved
],
extras_require={
'tensorflow_cpu': ['tensorflow-cpu>=2.4.0rc0, <2.5',],
Expand Down