-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[GraphBolt] Partitioned S3-FIFO Feature Cache implementation #7492
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
Conversation
|
To trigger regression tests:
|
339583c to
c8bac66
Compare
frozenbugs
left a comment
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.
Overall looks good now, after the latest comments addressed should be good to go.
|
There is no way to force from a base class so that all derived classes have the same constructor @frozenbugs. So I don't have a way to force derived classes to have a constructor that take a single capacity parameter. |
|
With the most recent changes, the |
|
|
||
| template <typename CachePolicy> | ||
| PartitionedCachePolicy::PartitionedCachePolicy( | ||
| CachePolicy, int64_t capacity, int64_t num_partitions) |
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.
why force user to pass in an instance of CachePolicy which is not used at all here?
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.
I had to instantiate the template somehow.
Description
The S3-FIFO cache policy logic is serial for now. The partitioned policy partitions the keys in a deterministic manner to different cache policies we construct, so that each policy can run in parallel. Since performance is important, phmap hash table is used instead of std::unordered_map, which is available as a submodule. I went ahead and updated it to the latest available version to take advantage of potential bug fixes and performance improvements.
40 threads lead to a speedup of around 17x in my preliminary experiments with no change to the cache miss rate.
#7508 aligns the current implementation more with the reference implementation in https://socket.dev/pypi/package/cachemonCache/files/0.0.2/tar-gz/cachemoncache-0.0.2/src/cachemonCache/cache/s3fifo.py
Checklist
Please feel free to remove inapplicable items for your PR.
Changes