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

feat: use lru_dedup_dict for rank call #569

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

bassmang
Copy link
Member

@bassmang bassmang commented Mar 9, 2023

No description provided.

include/live_model.h Outdated Show resolved Hide resolved
rlclientlib/lru_dedup_cache.h Outdated Show resolved Hide resolved
rlclientlib/vw_model/safe_vw.cc Outdated Show resolved Hide resolved
rlclientlib/vw_model/safe_vw.cc Outdated Show resolved Hide resolved
@@ -67,6 +67,14 @@ int vw_model::update(const model_data& data, bool& model_ready, api_status* stat
return error_code::success;
}

int vw_model::add_lru_dedup_cache(uint64_t hash, std::string action_str, api_status* status)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably move the "parse action and populate the cache" functionality into vw_model and just have a pointer of it in each vw instance

that way whenever you use vw for a rank call we could just do

auto vw = _vw_pool.get_or_create()
vw.set_action_cache(&action_cache)
vw.rank(...)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the way it is done here the specific action is only passed into one of the vw instances in the object pool

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed lru_cache from safe_vw and constructor etc. Added as an arg to load_action and rank in safe_vw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants