Repository navigation
Fix transcription failure after Windows screen lock (#39) - #41
Merged
Merged
Conversation
WebGPU OrtRun fails with "Failed to download data from buffer" when the GPU instance is torn down (common on Windows lock). Detect that class of errors and continue the current speech segment on WASM instead of aborting. Co-authored-by: Wassim Gharbi <wassgha@gmail.com>
Keep getAsr close to the original shape, and express mid-run GPU loss as a single try/catch retry around each speech slice instead of nested attempt loops. Co-authored-by: Wassim Gharbi <wassgha@gmail.com>
wassgha
marked this pull request as ready for review
July 30, 2026 06:52
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.
Summary
Fixes #39: when transcription is running on WebGPU and Windows locks the screen, Chromium tears down the GPU instance. ONNX Runtime then fails with
Failed to download data from buffer/A valid external Instance reference no longer exists, and the job aborts.This change detects that class of WebGPU device-loss errors mid-transcription, reloads Whisper on WASM, and retries the current speech segment so the run can finish instead of surfacing a raw OrtRun error.
Changes
isWebGpuDeviceLostError()(lib/webgpu.ts) matching the OrtRun /mapAsyncfailure from the issuegetAsr()close to its original shape; trackforceWasm/asrDevicefor fallbackscripts/webgpu-test.tsTest plan
npx tsx scripts/webgpu-test.tseslinton touched filestsc --noEmit