Run Sortformer diarization on GPU via DirectML on Windows - #30
Open
egsok wants to merge 1 commit into
Open
Conversation
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>
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.
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
directmlcargo feature of parakeet-rs on Windows (target-gated, other platforms unchanged) and passes anExecutionConfigwithExecutionProvider::DirectMLinstead ofNone.SONA_DIARIZE_EP=cpuopts out explicitly.ExecutionConfig/ExecutionProviderre-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: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.dllnext 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