perf: overlap patch reads in split correction, honor percentiles - #766
Merged
Conversation
Split-correction feature extraction read image patches synchronously with the caller's forward pass, and computed all skeleton features before issuing the first read, so neither the GPU nor the network was kept busy. - FeaturePipeline: launch the patch reads before computing skeleton features so the two overlap. Image features are stored after the skeleton pass, since proposal profiles are concatenated onto the skeleton-based proposal features. - FragmentsDataset: use the prefetch parameter, which was previously unused, to extract features for upcoming batches on a background thread. This overlaps extraction with the caller's forward pass and bounds the number of resident batches. Lower the default to 2, since each queued batch now holds its image patches in memory. - ImageFeatureExtractor: pin max_workers to 32, where read throughput plateaus, rather than inheriting a cpu-count-derived default. - Pass percentiles through to the ImageConfig that ImageFeatureExtractor builds, which dropped the caller's value and normalized with the ImageConfig default. SplitInferenceConfig now carries the value, mirroring the existing patch_shape override. - Store feature matrices as float32 rather than float64, halving the host-to-device transfer of image patches. Note: split inference now normalizes with percentiles (1, 99.9), where it previously always used (1, 99.5) regardless of configuration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Split-correction feature extraction read image patches synchronously with the caller's forward pass, and computed all skeleton features before issuing the first read, so neither the GPU nor the network was kept busy.
Note: split inference now normalizes with percentiles (1, 99.9), where it previously always used (1, 99.5) regardless of configuration.