Reuse Cua-S1 image preprocessing and vision features per request - #17
Open
Levius-Fubuki wants to merge 18 commits into
Open
Levius-Fubuki wants to merge 18 commits into
Levius-Fubuki wants to merge 18 commits into
Conversation
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.
Purpose
A request with eight questions over one screenshot currently preprocesses and encodes that image eight times. This change performs image preprocessing and adapted vision encoding once per multi-question request, while preserving independent prompts, candidate order, text embeddings, 3D positions and language forwards. Single-question requests retain the original path. Every prompt is validated before inference; features remain request-local, including failure paths.
On RTX 4090, 17 paired workloads / 3,400 timed requests show 6.8–19.9% lower p50 latency for multi-question cases. Eight distinct questions improve from 1100.03 / 1094.87 ms to 887.54 / 888.45 ms across two runs. Single-question p50 remains within measured noise (−0.5% to +1.1% reduction).
Depends on #12 and #15. This branch includes their commits until they merge; this PR's new work begins after
4c605e3. It is a Transformers/PEFT request-local reuse optimization, not a native CUDA backend or custom kernel.Full results, raw samples, tensor interface and reproduction commands.
Test Plan
System1-Omni Version / Commit: timed clean source
c18a21b; final GPU-host CPU/oracle/HTTP checks at clean9f4a4fe. Later commits add result evidence and documentation; measured model and benchmark code are unchanged.Test Result