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

Optimize node ID hashing, DynLayout construction #92

Merged
merged 3 commits into from
Apr 13, 2024

Conversation

robertknight
Copy link
Owner

This is a collection of small optimizations for graph executions with many operations relative to compute. These were found by profiling main-thread execution time of the whisper-rs demo.

Replace the `product` iterator call from the loop which calculates strides, with
a reversed loop which calculates the strides incrementally.

Previously this call accounted for ~1% of the main-thread time in a Whisper
benchmark, now it is about 0.2%.
This provides hashing at the expense of not being DOS-resistant. That's OK in
this context because the keys are all `NodeId`s, which we control.
@robertknight robertknight merged commit 52ceceb into main Apr 13, 2024
2 checks passed
@robertknight robertknight deleted the dynlayout-from-shape branch April 13, 2024 07:05
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