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

Add vm.buffer.hash and util.buffer.hash ops #16003

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

qedawkins
Copy link
Contributor

This adds support for computing the SipHash24 of a byte range of a buffer, with the goal of using this as a primitive for building a hash table out of VM IR.

@qedawkins qedawkins marked this pull request as ready for review December 27, 2023 14:49
This adds support for computing the SipHash24 of a byte range of a buffer,
with the goal of using this as a primitive for building a hash table out
of VM IR.
Copy link
Collaborator

@benvanik benvanik left a comment

Choose a reason for hiding this comment

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

Minor style nits and such,

It'd be nice to know how we could make this incremental (an optional state buffer, etc) but that can come with some larger crypto module that does more stuff than what this is intended for (basic hashing of simple bytes spans). Keeping it simple here means we can optimize it pretty tightly/port it pretty easily!

runtime/src/iree/vm/BUILD.bazel Outdated Show resolved Hide resolved
runtime/src/iree/vm/buffer.c Outdated Show resolved Hide resolved
runtime/src/iree/vm/buffer.c Show resolved Hide resolved
runtime/src/iree/vm/buffer.h Show resolved Hide resolved
runtime/src/iree/vm/buffer.c Outdated Show resolved Hide resolved
@qedawkins
Copy link
Contributor Author

Minor style nits and such,

It'd be nice to know how we could make this incremental (an optional state buffer, etc) but that can come with some larger crypto module that does more stuff than what this is intended for (basic hashing of simple bytes spans). Keeping it simple here means we can optimize it pretty tightly/port it pretty easily!

I found this investigation of a few different choices for incremental hash functions so maybe we can import learnings from there: rust-lang/rust#41215

@qedawkins qedawkins merged commit a7a7ad6 into iree-org:main Jan 9, 2024
57 checks passed
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