Repository navigation
Refactor Granite5ASR graph reuse and batch GPU attention - #1335
Merged
Merged
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.
Granite5ASR rebuilt and allocated its encoder graph on every request. Retain the latest input shape in a session-owned
PreparedGraph, batch independent GPU attention blocks, and keep the final partial block separate. CPU retains per-block attention.All changes are model-local, including the model spec and usage documentation. No framework, GGML, CLI or server changes.
Validation
Default Q8 GGUF, Debug build, eight threads, RTX 5090 / Ryzen 9 7900X. Main-versus-branch comparisons match text, language, word timestamps and serialized confidence values on CUDA, Vulkan and CPU: 17 offline requests, nine streaming API requests, eight block-boundary requests and three same-shape input-change requests per backend and revision.
Coverage includes English/Japanese, chunking, long-to-short reuse, 127/128/129/256/257-frame boundaries, and replacing input content without changing its shape. Streaming remains the existing finalize-based transcription path.
Warmed repeated requests, sequential A→B→B→A, 16 measured samples per recording and revision:
CUDA repeated requests improve by approximately 23% and 11%. CPU is approximately unchanged on the short clip and 2.1% slower on the longer clip. Mixed-shape timings varied: Vulkan RTF ranged from 0.00349–0.00700 on main versus 0.00333–0.00627 after refactoring; some CUDA/CPU mixed-shape samples were slower, so this is not a blanket performance-regression-free claim.
Benchmark peak VRAM remains essentially unchanged: CUDA 1276→1276 MiB; Vulkan 681→682 MiB.
Final Debug build and model-spec checks passed. Native BF16/F16 and HIP/Metal execution were not validated in this pass.