Skip to content

Conversation

hgarrereyn
Copy link

This PR modifies the shared object handle to store a tag with cached objects. By default, shared.acquire will keep a reference until it is garbage collected. By specifying a tag, the user can force cache eviction if the tag passed with acquire doesn't match the tag stored with the cached object.

This PR does not change public APIs but it is a prerequisite for the model streaming api where RunInference may need to force cache eviction of models loaded in memory.

Currently, shared.py is migrating to Beam core however RunInference still depends on the tfx-bsl version. Eventually this PR will also need to be reflected in the Beam version of shared.py.

@hgarrereyn
Copy link
Author

@aaltay
Copy link

aaltay commented Jul 31, 2020

LGTM. Nice idea.

@hgarrereyn
Copy link
Author

this was merged

@hgarrereyn hgarrereyn closed this Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants