-
Notifications
You must be signed in to change notification settings - Fork 140
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
add reserved_key_start_bit option to config hkv #408
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ def __init__( | |
evict_strategy=HkvEvictStrategy.LRU, | ||
step_per_epoch=0, | ||
gen_scores_fn=None, | ||
reserved_key_start_bit=0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A simple explanation of config reserved_key_start_bit in document docs/api_docs/tfra/dynamic_embedding/HkvHashTableConfig.md, that would be better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
): | ||
"""Creates an empty `HkvHashTable` object. | ||
|
||
|
@@ -124,15 +125,15 @@ def __init__( | |
self._step_per_epoch = step_per_epoch | ||
self._gen_scores_fn = gen_scores_fn | ||
self._default_scores = tf.constant([], dtypes.int64) | ||
|
||
self._reserved_key_start_bit = reserved_key_start_bit | ||
if self._config: | ||
self._init_capacity = self._config.init_capacity | ||
self._max_capacity = self._config.max_capacity | ||
self._max_hbm_for_values = self._config.max_hbm_for_values | ||
self._evict_strategy = self._config.evict_strategy | ||
self._step_per_epoch = self._config.step_per_epoch | ||
self._gen_scores_fn = self._config.gen_scores_fn | ||
|
||
self._reserved_key_start_bit = self._config.reserved_key_start_bit | ||
self._shared_name = None | ||
if context.executing_eagerly(): | ||
# TODO(allenl): This will leak memory due to kernel caching by the | ||
|
@@ -183,6 +184,7 @@ def _create_resource(self): | |
strategy=self._evict_strategy.value, | ||
step_per_epoch=self._step_per_epoch, | ||
name=self._name, | ||
reserved_key_start_bit=self._reserved_key_start_bit, | ||
) | ||
|
||
if context.executing_eagerly(): | ||
|
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.
default value of reserved_key_start_bit is better to be same as python code which is 1.
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.
NVIDIA-Merlin/HierarchicalKV#191 set the default to 0