-
Notifications
You must be signed in to change notification settings - Fork 138
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
Support sparse_segment_sum ops on GPU. #55
Support sparse_segment_sum ops on GPU. #55
Conversation
from tensorflow_recommenders_addons.dynamic_embedding.python.ops.restrict_policies import ( | ||
RestrictPolicy, | ||
TimestampRestrictPolicy, | ||
FrequencyRestrictPolicy, | ||
) | ||
from tensorflow_recommenders_addons.dynamic_embedding.python.ops.dynamic_embedding_variable import ( |
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.
why delete ?
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.
I put it here to make it is ordered by alphabet.
@@ -14,6 +14,7 @@ | |||
# ============================================================================== |
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.
- Plz update "How to compile GPU version" to README.md.
- make workflow support GPU UnitTest.
- You just only add a op, but not apply to TFRA?
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.
- Accept.
- Currently, there is no available GPU host for UnitTest.
- Accept. The op is used in
de.embedding_lookup_sparse
.
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/segment_reduction_ops.h
Outdated
Show resolved
Hide resolved
"//conditions:default": ["-pthread", "-std=c++11", D_GLIBCXX_USE_CXX11_ABI], | ||
"//conditions:default": [ | ||
"-pthread", | ||
"-std=c++14", |
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.
Why upgrade to c++14?
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.
When reusing some code in Tensorflow 2.4.1, we need c++14 to pass the compilation.
Please tell me, how to allocate video memory? |
Just follow BFC when allocating the output tensor. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
README.md
Outdated
@@ -81,6 +81,13 @@ pip install tensorflow-recommenders-addons[tensorflow] | |||
``` | |||
|
|||
Similar extras exist for the `tensorflow-gpu` and `tensorflow-cpu` packages. | |||
|
|||
On default, install `tensorflow-recommenders-addons` with pip will download GPU version packages and |
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.
By default
download CPU version
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.
Accept
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/segment_reduction_ops_impl.h
Outdated
Show resolved
Hide resolved
@@ -8,6 +8,12 @@ _TF_SHARED_LIBRARY_NAME = "TF_SHARED_LIBRARY_NAME" | |||
|
|||
_TF_CXX11_ABI_FLAG = "TF_CXX11_ABI_FLAG" | |||
|
|||
TF_MAJOR_VERSION = "TF_MAJOR_VERSION" |
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.
when cuda is enabled, project name of whl should be 'tensorflow_recommenders_addons_gpu'
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.
GPU and CPU version should share the same version number.
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/segment_reduction_ops_impl.h
Outdated
Show resolved
Hide resolved
README.md
Outdated
##### Compatibility Matrix with GPU | ||
| TensorFlow Recommenders-Addons | TensorFlow | Compiler | CUDNN | CUDA | Compute Capability | | ||
|:----------------------- |:---- |:---------| :------------ | :---- | :------------ | | ||
| tensorflow-recommenders-addons-0.1.0 | 2.4.1 | GCC 7.3.1 | 8.2.0 | 11.0 | SM 3.5 and later | |
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.
make a list: 3.5, .......8.0.
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.
Accept.
LGTM |
SparseSegmentSum
andSparseSegmentSumWithNumSegments
are two important opeartions in sparse training and inference. Currently, there are no GPU impl in Tensorflow for them.This PR provide GPU version of
SparseSegmentSum
andSparseSegmentSumWithNumSegments