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

📦️ Fix macOS packaging #838

Merged
merged 1 commit into from
Feb 17, 2022
Merged

📦️ Fix macOS packaging #838

merged 1 commit into from
Feb 17, 2022

Conversation

connorbrinton
Copy link
Contributor

The TensorFlow Text package requires use of a matching minor version of TensorFlow. In order to support Apple Silicon macs, Tensorflow Text chooses between the tensorflow and tensorflow-macos packages automatically based on system architecture. However, I believe that commit a7e1b5b accidentally wiped out this logic. Additionally, this commit failed to increment the minor version of the tensorflow-macos dependency.

This typically isn't a problem for users installing TensorFlow Text using pip on non-Apple Silicon devices, since pip just tries to find the best set of packages for the current system. However, this is a problem for package managers like Poetry, which create a deterministic lock file allowing a similar set of dependencies to be installed across different systems, modulo any architectural differences. Since Poetry needs to resolve a combination of dependencies that will work for any system, it eagerly tries to identify a version of tensorflow-macos that will work on Apple Silicon devices. However, since the minor versions of the tensorflow and tensorflow-macos dependencies don't match, it's unable to find an appropriate version of keras that both can use. As a result, installing tensorflow-text (>=2.8.0) using Poetry is currently impossible.

These changes restore the logic to automatically select between tensorflow and tensorflow-macos based on platform and architecture identifiers, and bump the version of the tensorflow-macos dependency to match the minor version of tensorflow and tensorflow-text.

The TensorFlow Text package requires use of a matching minor version of TensorFlow. In order to support Apple Silicon macs, Tensorflow Text chooses between the `tensorflow` and `tensorflow-macos` packages automatically based on system architecture. However, I believe that commit a7e1b5b accidentally wiped out this logic. Additionally, this commit failed to increment the minor version of the `tensorflow-macos` dependency.

This typically isn't a problem for users installing TensorFlow Text using `pip` on non-Apple Silicon devices, since `pip` just tries to find the best set of packages for the current system. However, this _is_ a problem for package managers like Poetry, which create a deterministic lock file allowing a similar set of dependencies to be installed across different systems, modulo any architectural differences. Since Poetry needs to resolve a combination of dependencies that will work for _any_ system, it eagerly tries to identify a version of `tensorflow-macos` that will work on Apple Silicon devices. However, since the minor versions of the `tensorflow` and `tensorflow-macos` dependencies don't match, it's unable to find an appropriate version of `keras` that both can use. As a result, installing `tensorflow-text (>=2.8.0)` using Poetry is currently impossible.

These changes restore the logic to automatically select between `tensorflow` and `tensorflow-macos` based on platform and architecture identifiers, and bump the version of the `tensorflow-macos` dependency to match the minor version of `tensorflow` and `tensorflow-text`.
copybara-service bot pushed a commit that referenced this pull request Feb 17, 2022
@broken broken merged commit ad3d140 into tensorflow:2.8 Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants