-
Notifications
You must be signed in to change notification settings - Fork 373
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
Proof-of-concept: Hand-crafted optimizations to pave the way forward for code-gen #2954
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jleibs
added
🚀 performance
Optimization, memory use, etc
do-not-merge
Do not merge this PR
labels
Aug 9, 2023
jleibs
commented
Aug 9, 2023
.unwrap() | ||
.values() | ||
.as_slice(); | ||
let data2: &[[f32; 3]] = bytemuck::cast_slice(data); |
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.
This is one of the main things we want to generate for fixed-sized-arrays of primitives.
5 tasks
jleibs
added a commit
that referenced
this pull request
Aug 15, 2023
…#2970) ### What This implements 2 optimizations: - The first is ArrowBuffer optimization returns an inner Buffer directly when we know that the type itself it just an array of primitives. This is useful for zero-copy returns for dense data such as Tensors. - The second is the optimizations from: #2954 . For this, we identify cases where we know the inner arrays are not nullable and instead of using validity-iterators map directly to slices. Significant speedups for batch queries: ![image](https://github.com/rerun-io/rerun/assets/3312232/7ea1f3a2-a45a-4813-b82c-eaee55914c32) TODO: - [x] We should be able to check that the contents don't actually contain a validity map with non-nulls and return a deserialization error in that case. - [x] Add handling for other ArrowBuffer types. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2970) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2970) - [Docs preview](https://rerun.io/preview/pr%3Ajleibs%2Fcodegen_optimizations/docs) - [Examples preview](https://rerun.io/preview/pr%3Ajleibs%2Fcodegen_optimizations/examples)
These have all now been addressed properly. Closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Demonstrating that with the right generated deserializer optimizations the new code-gen can out-perform the legacy queries.
There's a couple of performance improvements all rolled in here to really push the envelope:
Using the photogrammetry example as a stress-test:
Previous Baseline (0.8)
Before (main):
After:
Checklist