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

[Embedding] Support StaticGPUHashMap to optimize GPU EmbeddingVariable in inference. #878

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tensorflow/core/framework/embedding/embedding_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ namespace tensorflow {
EventMgr* event_mgr);
#endif //GOOGLE_CUDA

namespace {
const char* kInferenceMode = "INFERENCE_MODE";
}

template <class K, class V>
class GPUHashTable;
Expand Down Expand Up @@ -632,6 +629,13 @@ class EmbeddingVar : public ResourceBase {
storage_->BatchLookupOrCreateKeys(key, item_idxs, n, device);
}

void Lookup(const K* key, V* val, V* default_v,
int32 default_v_num, bool is_use_default_value_tensor,
size_t n, const Eigen::GpuDevice& device) {
storage_->BatchLookup(key, val, default_v, default_v_num,
is_use_default_value_tensor, n, device);
}

int32 SlotNum() {
return (emb_config_.block_num * (1 + emb_config_.slot_num));
}
Expand Down
Loading