Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whisper medium error with DirectML #1240

Open
thewh1teagle opened this issue Aug 9, 2024 · 1 comment
Open

Whisper medium error with DirectML #1240

thewh1teagle opened this issue Aug 9, 2024 · 1 comment

Comments

@thewh1teagle
Copy link
Contributor

thewh1teagle commented Aug 9, 2024

When running whisper medium (int8 / normal) on DirectML provider it failed. on CPU it works. same build.

The error

Non-zero status code returned while running MemcpyToHost node

Reproduce

cmake -B build -DCMAKE_BUILD_TYPE=Release -DSHERPA_ONNX_ENABLE_DIRECTML=ON -DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF -DSHERPA_ONNX_ENABLE_TTS=OFF -DSHERPA_ONNX_ENABLE_BINARY=ON -DSHERPA_ONNX_BUILD_C_API_EXAMPLES=ON .

Change provider to DirectML in whiser-c-api and medium.int8

cmake --build build --config Release --target whisper-c-api

Result (failed)

Time taken for create recognizer: 13.49 seconds
2024-08-09 17:22:45.9754547 [E:onnxruntime:, sequential_executor.cc:494 onnxruntime::ExecuteKernel] Non-zero status code returned while running MemcpyToHost node. Name:'Memcpy_token_244' Status Message: D:\a\_work\1\s\onnxruntime\core\providers\dml\DmlExecutionProvider\src\MLOperatorAuthorImpl.cpp(2429)\onnxruntime.dll!00007FF9B54FE1D6: (caller: 00007FF9B5A25FC7) Exception(3) tid(2f08) 887A0006 The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application.

D:\sherpa\sherpa-onnx\sherpa-onnx/csrc/offline-recognizer-whisper-impl.h:DecodeStream:176 

Caught exception:

Non-zero status code returned while running MemcpyToHost node. Name:'Memcpy_token_244' Status Message: D:\a\_work\1\s\onnxruntime\core\providers\dml\DmlExecutionProvider\src\MLOperatorAuthorImpl.cpp(2429)\onnxruntime.dll!00007FF9B54FE1D6: (caller: 00007FF9B5A25FC7) Exception(3) tid(2f08) 887A0006 The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application.


Return an empty result. Number of input frames: 663, Current tail paddings: 1000. If you see a lot of such exceptions, please consider using a larger --whisper-tail-paddings
Decoded text:
Time taken: 2.83 seconds
Decoded text:

Change provider to CPU in whisper-c-api and medium.int8

cmake --build build --config Release --target whisper-c-api

Result (success)

Time taken for create recognizer: 10.05 seconds
Decoded text:  After early nightfall the yellow lamps would light up here and there the squalid quarter of the brothels.
Time taken: 15.26 seconds
Decoded text:  After early nightfall the yellow lamps would light up here and there the squalid quarter of the brothels.

Change provider to DirectML and model to tiny.int8

Result (success)

Time taken for create recognizer: 1.39 seconds
Decoded text:  After early nightfall, the yellow lamps would light up here and there the squalid quarter of the brothels.
Time taken: 2.25 seconds
Decoded text:  After early nightfall, the yellow lamps would light up here and there the squalid quarter of the brothels.

Maybe related:
dog-qiuqiu/Ultralight-SimplePose#5
microsoft/onnxruntime#3205
#1037

By the way I can that it loads some of the model into the GPU memory. like 2GB and then fail (I have 8GB GPU)

Happens also in test whisper script

Maybe a fix: onnx/models#156 (comment)

@thewh1teagle
Copy link
Contributor Author

Turns out it happens with scripts/whisper/test.py as well.
I created new issue in onnxruntime
microsoft/onnxruntime#21805

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

No branches or pull requests

1 participant