Skip to content

Run Sortformer diarization on GPU via DirectML on Windows - #30

Open
egsok wants to merge 1 commit into
thewh1teagle:mainfrom
egsok:feat/directml-diarization
Open

Run Sortformer diarization on GPU via DirectML on Windows#30
egsok wants to merge 1 commit into
thewh1teagle:mainfrom
egsok:feat/directml-diarization

Conversation

@egsok

@egsok egsok commented Jul 18, 2026

Copy link
Copy Markdown

Motivation

Diarization currently runs synchronously before transcription with the parakeet-rs default execution config — CPU with 4 intra-op threads. On long recordings this is a multi-minute silent phase before the first stream event, which surfaces in Vibe as "stuck at 0%" (thewh1teagle/vibe#927 — I reproduced it and this is the root cause; writing a comment with the full diagnosis there).

What this does

  • Enables the directml cargo feature of parakeet-rs on Windows (target-gated, other platforms unchanged) and passes an ExecutionConfig with ExecutionProvider::DirectML instead of None.
  • DirectML needs no extra runtime dependencies on Windows, and ort registers a CPU fallback automatically, so machines without a usable GPU keep working. SONA_DIARIZE_EP=cpu opts out explicitly.
  • On non-Windows platforms (and CPU fallback), uses all available cores instead of the crate default of 4 intra-op threads.
  • Bumps the parakeet-rs requirement to 0.3.6 (already what Cargo.lock resolves) — the ExecutionConfig/ExecutionProvider re-exports this patch uses appeared after 0.3.2.

Measurements

40-minute WAV, Windows 11, RTX 5070 Ti, large-v3-turbo, beam_size 5, diar_streaming_sortformer_4spk-v2.1.onnx, transcription on Vulkan in all cases:

time to first stream event total request
CPU (current main) 162 s 186 s
DirectML (this PR) 76 s 84 s

Speaker assignments are identical to the CPU baseline on the same inputs (same segment boundaries and labels, including a 2-voice alternating test file).

One packaging note: ort's pyke binary distribution ships a newer DirectML.dll next to the built binary; without it, Windows falls back to the System32 copy, which still works but may be older. Worth considering for Vibe's bundling.

🤖 Generated with Claude Code

Diarization runs synchronously before transcription with the parakeet-rs
default execution config (CPU, 4 intra threads). On long recordings this
is a multi-minute silent phase before the first progress event — the
root cause of "stuck at 0%" reports like thewh1teagle/vibe#927.

Pass an ExecutionConfig that selects the DirectML execution provider on
Windows (ort registers a CPU fallback automatically if the provider is
unavailable; SONA_DIARIZE_EP=cpu opts out) and use all available cores
instead of 4 for CPU execution on other platforms.

On a 40-minute WAV (RTX 5070 Ti, large-v3-turbo, beam 5): time to first
stream event drops from 162s to 76s, total request time from 186s to
84s. Speaker assignments are identical to the CPU baseline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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