-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Support building Kaldi to WASM with OpenBLAS #4954
base: master
Are you sure you want to change the base?
Conversation
@jtrmal PTAL at the changes as well as the guide itself here: https://github.com/msqr1/kaldi-wasm2. I also have to force the number threads spawned by Kaldi to be 1 because WASM is quite complicated with multiple threads (we can support that later). I know Thanks! |
Hi, thank you, will try to get to this this week
y.
…On Wed, Oct 16, 2024 at 7:39 AM __Rylex__ ***@***.***> wrote:
@jtrmal <https://github.com/jtrmal> PTAL at the changes as well as the
guide itself here: https://github.com/msqr1/kaldi-wasm2.
Thanks!
—
Reply to this email directly, view it on GitHub
<#4954 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUKYX2XXMXCPSAVDJKVCNTZ3X3XTAVCNFSM6AAAAABP7NIIG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJVG43TSMJUHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Could you answer my question so I can work on it? |
I'm sorry I don't see any question.
Y.
…On Wed, Oct 16, 2024 at 19:07 __Rylex__ ***@***.***> wrote:
Could you answer my question so I can work on it?
—
Reply to this email directly, view it on GitHub
<#4954 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUKYXY3SMLR6LAJP3ZQYF3Z32MM3AVCNFSM6AAAAABP7NIIG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJXGQZDKMBZGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Is there any other place where kaldi spawn threads other than the controlled g_num_threads in kaldi_thread.cc? |
I think just from libraries e.g. some math libraries, like MKL, spawn their own threads. (This is usually not helpful and should be disabled by appopriate environment variables or liberary versions) |
OK, so I can force kaldi to spawn 1 thread by setting g_num_threads to 1. I will have to force all creations of std::thread to be 1 when building to WASM (except the CUDA ones), right? Btw, what is the difference between g_num_threads =1 vs =0? @danpovey |
The vast majority of Kaldi programs only use one thread anyway so you probably don't have to do anything in most cases. |
By the way, sherpa-onnx also uses a single thread in its WebAssembly ASR and TTS APPs. And the speed also looks OK, e.g., it is able to do real-time speech recongition. |
Thanks! I will TAL at that later. For now, I'm just fixing the threading issue to get this donr! |
I wouldn't attempt to complie the entirety of Kaldi to WASM because the binary size would be enormous. There are |
Kaldi with OpenBLAS 0.3.28 with some mini hacks and performance increased by 20% (#4952)