Fix for error Use '_unsafe_update_src()' when transcribing with word_timestamps=True and using cuda acceleration on linux #2597
abdallah-hammad-dev
started this conversation in
General
Replies: 1 comment
-
Following the steps above threw the same error. The fix that worked for me was to run the installation from pypi (although you probably could install from git as well):
Then running:
to force the triton version to be 3.2.0 with whisper. Note that if you walk back the triton version to be 3.2.0, and then try the fix to apply the new kernel and clear the hash, this will throw the error
which seems to indicate that there's an unresolved issue with changes in the triton library. Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Fixing Whisper word_timestamps with CUDA acceleration on Linux
I encountered this error when enabling
word_timestamps=True
with CUDA acceleration on Linux:The triton_ops.py file didn't use
_unsafe_update_src
like the error message suggests, but directly changed kernel src usingkernel.src = kernel.src.replace(...)
. If i have understood correctly this is a new constraint introduced in the Triton 3.0 API and later (which is a dependency of newer PyTorch versions).The Fix
Here are the changes I made to fix this issue:
Line 62:
Every instance of:
on lines 63, 72 and 93 becomes:
(modifying the copy instead of the original)
Just before the
return kernel
, add these lines to apply the new kernel src and clear hash:This is the first time I've patched library code like this. I hope it helps anyone else facing the same issue! The accelerated transcription now works perfectly on my machine.
Beta Was this translation helpful? Give feedback.
All reactions