Skip to content

Expose Qwen3-ASR performance controls and cuda_perf preset - #1156

Merged
0xShug0 merged 2 commits into
mainfrom
perf/qwen3-asr-experiments
Nov 1, 2026
Merged

0xShug0 merged 2 commits into
mainfrom
perf/qwen3-asr-experiments

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Expose independent Qwen3-ASR decoder performance controls and an opt-in cuda_perf preset. Explicit session options override the preset, including false, F32 KV, alignment 1 and batch size 1.

Session option (qwen3_asr. prefix) Default / off cuda_perf
attention mixed flash
packed_projections false true
kv_cache_type f32 f16
kv_cache_alignment 1 256
offline_batch_size 1 2
  • Defaults preserve main's manual prefill, flash cached decoding, separate projections, F32 KV and single-chunk decoding. attention also accepts auto and eager.
  • Pair existing independent offline chunks through the framework batched decoder, preserving chunk boundaries, ordering and independent EOS/token limits. Decode an unpaired tail individually. Streaming scheduling is unchanged.
  • Use existing packed-projection, decoder and attention-policy modules. Attention buckets cover the aligned visible prefix; they do not introduce sliding-window attention.
  • Reuse decoder scratch memory through an opt-in shared-runtime allocation setting. Persistent inputs/KV remain live; aligned decoding does not allocate intermediates for an unused full-capacity graph. Qwen3-ASR enables this allocation policy whenever it uses the batched runtime, independently of the preset. The original default single-item allocation and other shared-runtime callers remain unchanged.
  • Update the compiled option catalog, v1 spec and model documentation. Log resolved settings. No GGML/kernel, server or UI changes.

Performance

Main 8da1c395 versus the combined controls and memory fix. RTX 5090, Debug/CUDA 12.9, eight CPU threads, native Q8 packages. All measurements ran sequentially with automatic language detection, default 30-second chunking and unchanged generation limits. RTF uses total CLI request wall time divided by source-audio duration; warmup is excluded. Peak VRAM includes loading and warmup, sampled every 20 ms.

The long-form session is one short warmup, one 178-second English request, then a different 180-second Danish request. Neither measured input is repeated. The FLEURS session is one short warmup followed by 500 distinct recordings in fixed order; 483 clips are at most 30 seconds and 17 require chunking.

Workload Q8 model Main RTF PR cuda_perf RTF Main peak VRAM PR peak VRAM
Two distinct long requests 0.6B 0.01044 0.00917 3,028 MiB 2,842 MiB
Two distinct long requests 1.7B 0.01395 0.01130 4,290 MiB 4,114 MiB
500 FLEURS clips 0.6B 0.01057 0.01317 3,028 MiB 2,778 MiB
500 FLEURS clips 1.7B 0.01422 0.01672 4,290 MiB 4,062 MiB

The two distinct long requests take 12.2% / 19.0% less generation time, with 186 / 176 MiB less peak VRAM for 0.6B / 1.7B. The mostly short FLEURS workload instead has 24.6% / 17.6% higher RTF, despite lower peak VRAM. This trade-off is why the preset remains opt-in.

Separately, interleaved comparisons against the same combined settings before scratch reuse reduced peak VRAM by 218 / 222 MiB; average RTF changes were within ±0.3% and inside the observed run variation. All transcripts matched the pre-allocation-change version.

Accuracy

All 500 held-out FLEURS recordings were evaluated for each model and configuration: 100 each for Mandarin, English, German, Spanish and French. Human reference transcripts, identical files/order and normalization on both sides. These files were used for evaluation, not implementation iteration.

Corpus WER/CER sums edit counts before dividing by reference units. Normalization uses Unicode NFKC/casefold, retains accents, removes punctuation apart from internal apostrophes, and unifies typographic apostrophes. Mandarin uses character error rate with whitespace/punctuation removed. No spoken-number normalization.

Language / metric 0.6B main → preset 1.7B main → preset
Mandarin CER 7.762% → 7.992% 6.356% → 6.335%
English WER 5.023% → 5.140% 3.505% → 3.388%
German WER 6.531% → 6.490% 4.776% → 4.816%
Spanish WER 4.857% → 4.762% 2.744% → 2.744%
French WER 8.165% → 8.268% 4.734% → 4.837%

Changes are small and mixed, not strict numerical/output parity. Some edit-count changes reflect formatting, such as digits versus written time expressions. The long-form recordings do not have verified reference transcripts, so no long-form WER is claimed.

Validation

  • Main, PR default and the preset with all five controls explicitly restored produced identical transcripts for both Q8 models on the short warmup and two distinct long requests. Default peak VRAM also matched main: 3,028 / 4,290 MiB.
  • Eleven CUDA configurations, each with a single request, two-chunk request and odd three-chunk request: individual controls, preset, explicit preset-equivalent settings, full default restoration, batch-size override, eager attention and automatic attention. All 33 requests completed; resolved logs matched the requested values.
  • Preset-only output matches the preserved pre-interface combined mode. Explicit preset-equivalent controls match the preset; full overrides match default.
  • Separate three-chunk → five-chunk → three-chunk checks completed with stable repeated transcripts and working unpaired tails.
  • Existing generic decoder tests extended for reused scratch, aligned/unaligned attention, unequal/equal lanes, repeated prefills and bucket transitions; passed on CUDA and CPU.
  • Debug builds, typed model-spec validation and diff checks passed. Full-model Vulkan and HIP validation is reported below.

Vulkan

PR default versus PR cuda_perf on an RTX 5090, using the same Debug binary, Q8 packages, eight CPU threads and the long-form session described above: one short warmup, then distinct 178-second English and 180-second Danish requests. Default chunking and generation limits. RTF excludes warmup; peak VRAM covers the whole session with 20 ms sampling. Measurements ran sequentially.

Q8 model PR default RTF PR cuda_perf RTF Generation-time reduction PR default peak VRAM PR cuda_perf peak VRAM
0.6B 0.01013 0.00990 2.3% 2,355 MiB 2,159 MiB
1.7B 0.01360 0.01207 11.2% 3,613 MiB 3,431 MiB

One session per model/mode; the small 0.6B timing difference may be run variation. All requests completed, with all five preset controls active on Vulkan. In a separate 28-second, two-chunk reference test, both models had 0/82 word errors. No long-form WER or bitwise cross-backend parity is claimed.

AMD HIP

AMD Radeon 8060S (gfx1151), ROCm 7.2.1, native Q8 packages, eight CPU threads, one Debug/C++17 binary. Sequential A–B–C–C–B–A comparison: PR default, cuda_perf, and cuda_perf with --backend-impl gfx1151_v1. Each session uses a short warmup followed by two different repository recordings (327.6 s and 167.3 s). RTF excludes warmup and averages two sessions per configuration. These recordings differ from the CUDA/Vulkan English/Danish pair above.

Model PR default RTF cuda_perf RTF cuda_perf + gfx1151_v1 RTF Preset time reduction
0.6B 0.05587 0.02572 0.02611 54.0%
1.7B 0.08325 0.04348 0.04349 47.8%

All 12 sessions (36 requests) completed. Preset and preset-plus-kernel transcripts matched exactly. The preset substantially reduces generation time; selecting gfx1151_v1 adds no speedup in this workload. This comparison does not establish WER equivalence against PR default.

Metal

About 20% lower RTF

Audio Main Default RTF PR Default PR cuda_perf
Short (~60s) 0.03372 0.03357 0.02688
Long (~200s) 0.03615 0.03606 0.02912

@0xShug0
0xShug0 merged commit ae7b935 into main Nov 1, 2026
7 checks passed
@0xShug0
0xShug0 deleted the perf/qwen3-asr-experiments branch November 1, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant