-
Notifications
You must be signed in to change notification settings - Fork 133
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] Add HKV which is based on merlin HierarchicalHV #356
Conversation
return Status::OK(); | ||
} | ||
|
||
Status ExportValuesWithMetas(OpKernelContext* ctx) { |
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.
We have changed the Metas
concept to Scores
.
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.
Hi @LinGeLin , It would be better to change all of the Meta to Score. In the HKV, we do have change it permarnently.
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.
Can I update it later? Because we are currently using HKV bate6, and the changes to scores are in bate7. The code for setting the thrust custom allocator has not been released yet, so I would like to update it later. Also, we haven't registered the ExportMate operator yet, so we can consider it as a feature update in the future. Is that okay?
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.
If the user API is not named xxMetaxx, it's OK.
default_allocator_ = std::make_unique<nv::merlin::DefaultAllocator>(); | ||
} | ||
|
||
TFOrDefaultAllocator(OpKernelContext* ctx) { |
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.
Hi @Lifann, would you please help reviewing this class? Thank you~
tensorflow_recommenders_addons/dynamic_embedding/python/ops/math_ops.py
Outdated
Show resolved
Hide resolved
15ea0fc
to
cdbd764
Compare
9d54997
to
045f5cb
Compare
Please add a proper prefix for the PR title and each commit, like |
DONE |
The time consumption of CI is reduced significantly! Well done! |
tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_embedding_creator.py
Outdated
Show resolved
Hide resolved
...ecommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_hkv_impl.cu.cc
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_hkv.h
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_hkv.h
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/hkv_hashtable_op_gpu.cu.cc
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/hkv_hashtable_op_gpu.cu.cc
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_hkv.h
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_hkv.h
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/hkv_hashtable_ops.py
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/hkv_hashtable_ops.py
Show resolved
Hide resolved
values) | ||
return op | ||
|
||
def accum(self, keys, values_or_deltas, exists, name=None, shared_name=None): |
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.
Could you add scores=None
after the exists
for reserving the customized strategy supporting?
) | ||
return (values, exists) if return_exists else values | ||
|
||
def insert(self, keys, values, name=None, shared_name=None): |
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.
Could you add scores=None
after the values
for reserving the customized strategy supporting?
Hi @LinGeLin, I have no more comments. After your feedback on them, we can merge the PR. Thank you for your excellent job! |
07b5ca2
to
87d6224
Compare
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/hkv_hashtable_op_gpu.cu.cc
Outdated
Show resolved
Hide resolved
@@ -81,9 +83,17 @@ class HkvHashTableOfTensorsGpu final : public LookupInterface { | |||
ctx, (max_hbm_for_vectors_i64 >= 0), | |||
errors::InvalidArgument("params max_hbm_for_vectors less than 0")); | |||
|
|||
OP_REQUIRES_OK(ctx, GetNodeAttr(kernel->def(), "evict_global_epoch", |
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.
The evict_global_epoch
is required only when the strategy is EpochLru
or EpochLfu
. So, it should be under a condition of if (Strategy == kEpochLru/Lfu)
.
You may need to refer to this logic of global epoch and its default value: https://github.com/NVIDIA-Merlin/HierarchicalKV/blob/master/include/merlin_hashtable.cuh#L2262-L2270
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.
The default is 0. It doesn't matter, does it?
Description
Added hkv hashtable which is based on HierarchicalKV. This hashtable can be used to hierarchical store key-value (feature-embedding) on high-bandwidth memory (HBM) of GPUs and in host memory.
Type of change
Checklist:
How Has This Been Tested?
If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes:
*