Repository navigation
cua-s1: accelerate resident screenshot questions with matched prefix Graphs - #183
Open
Levius-Fubuki wants to merge 6 commits into
Open
Levius-Fubuki wants to merge 6 commits into
Levius-Fubuki wants to merge 6 commits into
Conversation
Levius-Fubuki
marked this pull request as ready for review
October 26, 2026 14:03
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Collaborator
|
Reviewed at
Minor:
Since |
Collaborator
Author
|
@psv666 @MrDongsls The merge conflicts are resolved. Could you please review this PR when you have a chance? Thanks! |
This branch has not been deployed
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.
Repeated questions about one screenshot repeat most language computation. This update combines GPU-resident features, ordinary-compatible request-local prefix reuse, and window Graphs. On the frozen 12-screenshot HTTP workload, mean latency falls 249.244 → 148.656 ms (40.4%), with exact ordinary outputs; sampled process maximum increases 438 MiB.
Dependency/scope: PR #184's foundation is now merged into
main; this PR adds resident windows and Graph integration on top. The large gain includes prefix computation reuse; window Graphs alone add a measured 1.4% mean reduction over prefix eager on this real workload. All controls remain opt-in. This PR is ready for review and remains unmerged.Required human contributor answers
The contributor explicitly reviewed and confirmed these answers and PR necessity in the implementation task on 2026-10-25.
What outcome are you trying to achieve?
Enable language CUDA Graphs when Cua-S1 vision features stay on the GPU, preserving screenshot preparation, prompts, probabilities and decision semantics. The goal is lower repeated-decision latency where measurements justify it; capture cost and fallback remain explicit.
What is the highest-leverage variable for that outcome?
CPU operator submission and kernel-launch overhead in language forward. The primary outcome is warmed complete-request p50/p95, with first-capture cost and GPU memory reported separately. Correct current-input execution is a prerequisite.
How will this work move that variable rather than create busywork?
Combine the existing resident-feature path and existing multimodal Graph path by staging current input into owned scratch before replay. Use matched eager/Graph evidence; keep the opt-in and do not claim every shape improves.
Who is the customer or user, and what do they actually need?
GUI/browser-agent operators serving Cua-S1 and native-worker maintainers. They need predictable screenshot decisions with unchanged API behavior, current data after screenshot/shape changes, safe cache retirement and recoverable capture failure, backed by focused tests and reproducible evidence.
After answering the four questions: is a PR needed at all to achieve this outcome?
Yes. The contributor confirmed this scope and requested submission after validation. It requires the shared execution change, root regressions and recipe updates.
For a bug fix: link actual observed failure evidence.
This is a capability extension. The new GPU test fails on main because resident execution makes no capture, then passes here. The exact red/green logs are in the qualification package below.
Purpose
Original #183 enables ordinary language Graphs over resident vision features. The follow-on routes matched-prefix execution through one host/device planner, copying current checked device rows into owned language scratch outside capture. Full-prompt GEMM descriptors must match for every question and support each window; incompatible/no-prefix/single-question requests retain ordinary independent execution.
Window cache keys include begin/end, both prefix source and capture destination allocation identities, and GEMM handle. Entries retain both allocations until retirement, bounded at 128. Scratch growth, FIFO eviction and matched-workspace retirement synchronize before freeing addresses. Recording failure retains the warmed eager result, disables language Graphs and clears caches. No schema, scheduler, prompt, precision or default change. No cross-request screenshot/answer cache.
Test plan and provenance
Conflict-resolution update (2026-10-27): merged
mainthrough32346fcb2b88a10ffa7c8d456ae74d0543972d03; updated headc4f68282b9d33ae6e2f1adefe01fd2f6843e0dc5. Preserved both the startup-symbol guard and resident window-Graph lifecycle logic; resolved the recipe/test whitespace conflicts. Local macOS verification: workspace Rust tests 379 passed / 0 failed / 94 ignored, strict all-target Clippy, release build withomni-laya/serve, formatting, strict MkDocs, CUDA contract plus 68 checker / 26 backend tests, and 135 Vela tests passed. The final Vela merge changes no Rust sources or Cua/Qwen fixtures. GPU/HTTP measurements and CI links below are historical qualification at48dfc6ffa; no new CUDA execution or performance measurement is claimed. GitHub reports the updated PR conflict-free; new CI runs are separate from the historical results.28f4957a6; original PRbase05075d0f; previous cua-s1: accelerate resident screenshot questions with matched prefix Graphs #183911faa0d22753be56c8bf513a23741dfa6d00593; final head48dfc6ffa42aaa4c6c72a077f70b1ecc6c870b46. Main’s shared-executor refactor is integrated, with Cua retaining its ordinary arithmetic and optional text packing disabled. Conflicts are resolved; current PR is mergeable.omni-laya/serve, format, strict MkDocs, CUDA contract plus68checker/26backend tests. Ignored tests are not device passes.Full HTTP result
Clock: native
/v1/systemonePOST through complete JSON/schema validation; concurrency1. Each suite visits O/E/G/G/E/O, four shuffled timed traversals per worker. Exclude one growth traversal, one stabilization traversal and5warmups per visit. 480 formal timed,300excluded and135feasibility calls remain separate. Timed regions contain no recapture/failure or foreign GPU process. p50=median,p95=pooled nearest rank; process GPU memory sampled about100ms, not allocator-exact peak.O=original183 resident Graph; E=resident matched prefix eager; G=resident matched prefix Graph. VisionGraph1 for all. Cache synthetic8/1024MiB, real16/2048MiB: workload controls, not new defaults.
G/O real mean/p95 reductions 40.4%/41.3%; descriptive paired complete-round mean bootstrap95% 40.2%–40.5%, describing this repeated workload only. Synthetic mean/p95 reductions 19.3%/36.3%. The small
case-1regresses4.2%; G synthetic p95 is1.7% worse than E. All per-case values are retained.Cold costs remain separate: real worker readiness20.07–21.07s; initial growth traversal mean milliseconds across the two visits: O253.2/253.8; E157.5/156.7; G159.5/159.8; no cold-start speedup claimed. Matched workspaces are bounded at16×32MiB, window Graphs at128 plus retained prefix allocations and vision budgets. Formal real matched profiles show48 admissions/visit and0 descriptor fallbacks; direct single-question/no-prefix fallback is separate and not counted by the descriptor trace.
Real quality is unchanged 119/192 correlated choice permutations over48screenshots, not official ScreenSpot accuracy or general GUI task success. Existing ordinary native-vs-FP32-reference limitations remain. No arbitrary-workload, other-hardware, throughput or concurrency claim.
Demo / evidence
Qualification release contains the sealed raw archive, portable audit, per-case table, protocol/reproduction, source/build/model identities, and shutdown verification. Public delivery
cua183-verified-raw-20261026.tar.xzSHA256e0bda4602cf48484ef41381b9dfe3d54a93daef9b6d00b8ade05ebcf5d29006ccontains both raw evidence directories with unchanged per-file inventories. The local original integrated gzipcontainer SHA256 ise7801ab180c331a950f22242339404b43ac39ec518b9a0131bd4c6cfccfbdac5;DELIVERY.jsonmaps the packaging change. Local verification checks all193file hashes, all783source files, measured executable/library bindings and raw-data recomputation. The pre-main c764 archive (SHA256e2cf87494c703f542e8acadc91616a5017ee6414f0acc764487a18b58fa22121,219files) is retained as its unchanged raw-directory payload alongside it; the recipe table records that historical measurement, while the table above is the fresh integrated result. Original screenshot pixels and credentials are omitted. Video:N/A; actual API measurements are retained.Historical initial/follow-up Graph evidence remains unchanged, including its original small/no general gain finding; it is not reused as evidence for this new implementation.
Platform shutdown has been acknowledged after verified local copy; two fresh SSH connections failed. An endpoint-free shutdown receipt is published. Exact-head CI and Docs passed; deployment is intentionally skipped for this PR.
Self-review
Full diff reviewed, independent ownership/admission findings resolved and covered. 1022 authored-code /1193 total changed lines against
mainat32346fcb2. Shared foundation is from #184; new orchestration stays in Cua/Qwen Rust, device operators in CUDA, tests under roottests/, one-off evidence external. Agent self-review and evidence verification are complete; the human checklist remains unchecked.