-
Notifications
You must be signed in to change notification settings - Fork 139
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
[feat]support Mac m1 devices #214
Merged
Merged
Conversation
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
rhdong
reviewed
Jan 30, 2022
rhdong
reviewed
Feb 10, 2022
rhdong
reviewed
Feb 10, 2022
rhdong
reviewed
Feb 10, 2022
tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_embedding_variable.py
Outdated
Show resolved
Hide resolved
rhdong
reviewed
Feb 10, 2022
if is_macos() and is_arm64(): | ||
if key_dtype == dtypes.half or value_dtype == dtypes.half: | ||
raise TypeError(""" | ||
Key or value dtype contains float16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Key or' is no needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""
float16
value dtype is not supported on macOS with ARM64 architecture. Please try another type.
"""
rhdong
reviewed
Feb 10, 2022
rhdong
reviewed
Feb 10, 2022
rhdong
reviewed
Feb 10, 2022
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Support Apple silicon devices:
Type of change
Checklist:
How Has This Been Tested?
The script has been tested manually in a blank virtual environment. The environment is as following:
OS: macOS Monterey 12.0.1
Python: 3.9.2
Tensorflow-macos 2.5.0
Bazel: 3.7.2/ 4.1.0 / 5.0.0
configure.py
was tested manually with Bazel version 3.7.2, 4.1.0, 5.0.0.dynamic_embedding_variable_test.py
dynamic_embeding_variable_test.py
was tested by running once.There is a known issue caused by float16.
All results using value dtype float16 don't match the expected results.
Thus, the
dynamic_embeding_variable_test.py
file has been updated to skip the testing value with float16 dtype if the platform is macOS arm64.The operation file
dynamic_embeding_variable.py
also included an exception handler to raise an error if the value is float16 and platform is macOS arm64.