Skip to content

Use gshash for Ghost KV Cache: apply crc32 to std::hash<std::string_view>#20

Merged
chenhao-ye merged 2 commits into
mainfrom
new-hash
Aug 21, 2025
Merged

Use gshash for Ghost KV Cache: apply crc32 to std::hash<std::string_view>#20
chenhao-ye merged 2 commits into
mainfrom
new-hash

Conversation

@chenhao-ye
Copy link
Copy Markdown
Owner

@chenhao-ye chenhao-ye commented Aug 21, 2025

It seems std::hash<std::string_view> does not necessarily produce evenly distributed bits. This can happen if using a small bench_size in test_ghost_kv.cpp.

This PR introduces gshash (s for string), which applies another crc32 to the hash value from std::hash<std::string_view>. This ensures the hash value has indeed evenly distributed bits.

@chenhao-ye chenhao-ye merged commit bddbaf5 into main Aug 21, 2025
1 check passed
@chenhao-ye chenhao-ye deleted the new-hash branch August 21, 2025 17:33
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.

1 participant