Repository navigation
Pool a batch of camera frames once, a chunk at a time - #46
Merged
Merged
Conversation
DynamicalIndexer.pooled gives observe and index the same pooled batch, so a batch is converted and pooled once rather than by each; LiveIndexer.pooled converts integer frames 128 at a time, so a batch of 1,024 frames of 512 x 512 is never a gigabyte of floats.
# Conflicts: # tests/index/test_live.py
This file contains hidden or 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
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
DynamicalIndexer.pooled(frames): the batch pooled to the refine shape on the device. Hand the result toobserveandindexin place of the frames. They index the same, bit for bit (test_pooled_frames_index_as_the_frames), and the batch is converted and pooled once instead of by each.LiveIndexer.pooledconverts integer frames to floatPOOL_CHUNK(128) at a time, so a batch is never held at full resolution as float. 1,024 frames of 512 x 512 would otherwise be a gigabyte.Why
At 512 x 512, Autopilot's live indexing spent a quarter of its time converting each batch twice. The ring overflowed, and the replayed scans showed dropped rows (black bars). With the batch pooled once, the 512 x 512 replay indexed 65,536 frames with none dropped.
Tests
test_integer_frames_are_pooled_a_chunk_at_a_time_as_a_whole(chunked integer pooling equals the whole batch pooled as float).tests/index/test_live.py: 43 passed on CUDA.ruff checkandruff format --checkare clean.