Enable Kokoro
🚀 The feature, motivation and pitch
https://huggingface.co/hexgrad/Kokoro-82M
Alternatives
No response
Additional context
No response
RFC (Optional)
No response
cc @mergennachin @iseeyuan @lucylq @helunwencser @tarun292 @kimishpatel
- Non-LSTM export is good (upstream, between, and downstream of problematic lstm calls)
- We already have optimized kernels to do op_fft_c2r.cpp kernel to do
istftand op_fft_r2c.cpp to dostft - Looking into
whilesupport for ET with @JacobSzwejbka - @pianpwk and @ydwu4 looking into LSTM rewrite with
while
We menaged to succesfully export the Kokoro model with static input shapes. The model is exported in 4 parts, and here is the repo containing all the necessary model source code changes & sample run scripts.
We’ve also successfully managed to export the Decoder with dynamic shapes. To get the other parts working with dynamic shapes, though, we'll need to resolve the LSTM issue. @jackzhxng, do you have any updates on how the LSTM dynamic shape support is coming along?
Can't wait to compare this with the onnx version! Haven't gotten that to run smoothly without blocking the main thread of my react native app.
Would this LSTM dynamic shape issue affect size/quality with your current approach @IgorSwat
See https://github.com/pytorch/executorch/issues/8468#issuecomment-3194843782
Would this LSTM dynamic shape issue affect size/quality with your current approach @IgorSwat
See #8468 (comment)
Yeah, definitely. So far we pad each LSTM input to the maximal length to omit this issue, but this causes the model to run much slower for shorter inputs. I believe we could save up to 40% of the inference time for short inputs like 3-6 words. Also significant amount of memory usage would be cut off.
Actually, since streaming mode relies on dividing the input for shorter sentences, it affects performance of any input size.