Speed up inference by overlapping I/O with GPU work#226
Open
kyroX-D wants to merge 3 commits intonikopueringer:mainfrom
Open
Speed up inference by overlapping I/O with GPU work#226kyroX-D wants to merge 3 commits intonikopueringer:mainfrom
kyroX-D wants to merge 3 commits intonikopueringer:mainfrom
Conversation
Introduce a prefetch thread that reads frames ahead of GPU processing and a background write pool for disk output. This prevents the GPU from idling during disk I/O, significantly improving throughput on 4K EXR sequences.
The CUDA allocator was forced to release and re-acquire memory blocks on every single frame, causing unnecessary overhead and fragmentation. Cache clearing is already handled at model-switch boundaries in service.py._ensure_model().
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 this does
Right now the inference loop processes frames one at a time read from disk, run GPU, write to disk, repeat. The GPU just sits there waiting whenever we're doing file I/O, which really adds up on longer sequences especially with 4K EXR files.
This PR fixes that by:
Files changed
Testing