Skip to content

Conversation

@yarri-oss
Copy link

Support for macOS Monterey

Description

Adding support for macOS Monterey M1 local build.

Brief Description of the PR:

Adding changes to bazel configuration and scripts to enable building from source for macOS Monterey M1.
Fixes # (issue)

Type of change

Checklist:

  • I've properly formatted my code according to the guidelines
    • By running Black + Flake8
    • By running pre-commit hooks
  • This PR addresses an already submitted issue for TensorFlow Addons
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • This PR contains modifications to C++ custom-ops

How Has This Been Tested?

Locally

If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes:
*

Support for MacOS Monterey
@google-cla google-cla bot added the cla: yes label Dec 1, 2021
Adding support for macOS Monterey
@@ -1 +1 @@
3.7.2
4.2.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any side effect about diverging version from https://github.com/tensorflow/tensorflow/blob/master/.bazelversion ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially, and if so this might justify a new approach to handle macOS TFA builds perhaps with a macos_m1 branch.

Created an issue to continue the discussion here: #2616

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't have a new rollback we are at 4.2.1 in https://github.com/tensorflow/tensorflow/blob/master/.bazelversion

if is_macos; then
if [[ x"$(arch)" == x"arm64" ]]; then
BUILD_CMD="${BUILD_CMD} --plat-name macosx_11_0_arm64"
BUILD_CMD="${BUILD_CMD} --plat-name macosx_12_0_arm64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we not going to distribute macosx_11 packages anymore?

I see that tensorflow-macosx wheels are still on macosx_11_0:
https://pypi.org/project/tensorflow-macos/2.6.0/#files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is build from source issue, so only local wheel files. We seem to have only a minimal macOS version support, but if I understand the platform correctly, we may need to change the build_pip_pkg.sh file to instead check for either x86 or M1 and OS version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is only local as we are using the same in Action:

https://github.com/tensorflow/addons/blob/master/.github/workflows/make_wheel_macOS_arm64.sh#L27

addons/BUILD

Line 3 in 41eaa27

srcs = ["build_deps/build_pip_pkg.sh"],

@seanpmorgan
Copy link
Member

Next Steps:

  • Drop bazel version increase (already done)
  • Increment the minimum build version in make_wheel_macOS_arm64 to 12
  • Increase the plat-name (as is done in this PR)

@seanpmorgan
Copy link
Member

@kulinseth we're looking to publish macos ARM64 wheels for TFA, but have heard that the package will not resolve for Monterey users since it's plat-name is for macos-11. Given that M1 chips have better performance on macos-12 (I think?) we wanted to make sure that majority of users will be able to resolve a TFA for macos-12 built for ARM.

However, I noticed tensorflow-macos is still publishing macos-11 plat-names:
https://pypi.org/project/tensorflow-macos/2.7.0/#files

  1. Is there a plan to increase the OS of the tensorflow-macos build?
  2. Also is it true that macos 12 users will not be able to resolve/install an earlier tensorflow-macos if it's labeled in pypi with a prior macos version? Thinking about this a bit more I'm confused since we publish our TFA x86_64 wheels for macos-10 and haven't heard this complaint.

@seanpmorgan seanpmorgan closed this Mar 1, 2023
@kulinseth
Copy link

@seanpmorgan , thanks for the issue:

@kulinseth we're looking to publish macos ARM64 wheels for TFA, but have heard that the package will not resolve for Monterey users since it's plat-name is for macos-11. Given that M1 chips have better performance on macos-12 (I think?) we wanted to make sure that majority of users will be able to resolve a TFA for macos-12 built for ARM.

These wheels should work on MacOS 12 as well. To make sure macos-11 users don't regress, we were releasing with plat-name macos-11.

However, I noticed tensorflow-macos is still publishing macos-11 plat-names: https://pypi.org/project/tensorflow-macos/2.7.0/#files

  1. Is there a plan to increase the OS of the tensorflow-macos build?

https://pypi.org/project/tensorflow-macos/2.11.0/#files
I think this has been addressed.

  1. Also is it true that macos 12 users will not be able to resolve/install an earlier tensorflow-macos if it's labeled in pypi with a prior macos version? Thinking about this a bit more I'm confused since we publish our TFA x86_64 wheels for macos-10 and haven't heard this complaint.

These should work for macos-12 users. When releasing your wheels you want to release for the minimum deployment target for MacOS which is supported. The arm64 support has been added since macos-11, and some users had requested support on Macos-11, so we were releasing with that plat-name. But since then macos-12 and macos-13 stable versions have been released, so we have bumped it up to macos-12. Please let me know if there are any concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants