Coder Social home page Coder Social logo

speed of LPCNet about lpcnet HOT 21 CLOSED

xiph avatar xiph commented on July 24, 2024
speed of LPCNet

from lpcnet.

Comments (21)

gosha20777 avatar gosha20777 commented on July 24, 2024 3

Yes, ind it s can work faster if organize data in memory (to prevent cache loss) arrange the data in memory (so that cache loss does not occur) and parallelize the execution of loops using, for example, OpenMP (#pragma omp parallel for)

from lpcnet.

jmvalin avatar jmvalin commented on July 24, 2024 2

Indeed, if you don't let it train long enough, then the weights won't be sparse. If you look at the training code, you'll see something like:
Sparsify(2000, 40000, 400, (0.1, 0.1, 0.1))
It means start the sparsification at batch (not epoch) 2000, and continue until batch 40000, setting weights to zero every 400 batches, with all 3 GRU matrices having 10% non-zero weights.

from lpcnet.

jmvalin avatar jmvalin commented on July 24, 2024

Right now the Python code is much slower than real-time, but once converted to C, it should be faster than real-time on both desktops and phones.

from lpcnet.

jmvalin avatar jmvalin commented on July 24, 2024

If you look at the current master, there's now C code that runs in real-time with just 20% CPU, i.e. around 250 times faster than the Python code.

from lpcnet.

attitudechunfeng avatar attitudechunfeng commented on July 24, 2024

I have tested the C code version, the speed is about 1.15 times faster that realtime, really great performance. However, considering the mel prediction model consumption and that current version doesn't seems to support a streaming process, there's space to optimize. Looking forward to further progresses.

from lpcnet.

jmvalin avatar jmvalin commented on July 24, 2024

What architecture and what NN model are you finding 1.15x faster than real-time? If you're on x86, you should see it run much faster, though previous models didn't have the block sparseness done properly and were slower. I recommend using master along with this model: https://jmvalin.ca/misc_stuff/lpcnet_models/lpcnet15_384_10_G16_100.h5
Note that you'll need to re-compute your features file since the definition has changed.

from lpcnet.

attitudechunfeng avatar attitudechunfeng commented on July 24, 2024

I tested on x86 arch and the model is lpcnet9_384_10_G16_120.h5. I'll try again as your recommendations.

from lpcnet.

attitudechunfeng avatar attitudechunfeng commented on July 24, 2024

The new version is about 3.95 times faster than realtime. It's really quite fast.

from lpcnet.

attitudechunfeng avatar attitudechunfeng commented on July 24, 2024

One more question, i've trained my own model. However, the model speed is much slower than your supported, is there something that i neglected ? thx.

from lpcnet.

jmvalin avatar jmvalin commented on July 24, 2024

Current master should generate models that will run just as fast as the one I linked to. If your model is slow, then maybe you're using a model trained with a version older than 7df3f9c. In any case, I'd recommend training with current master.

from lpcnet.

attitudechunfeng avatar attitudechunfeng commented on July 24, 2024

Thanks for your quick reply, with more training epochs(around 100~), the speed is normal. I guessed it maybe relates to the weights sparsity?

from lpcnet.

attitudechunfeng avatar attitudechunfeng commented on July 24, 2024

Thanks for your answer. I think it's practical now, and i'll try a whole tts process in following experiments. Really great work.

from lpcnet.

attitudechunfeng avatar attitudechunfeng commented on July 24, 2024

I've tried to use the pre model to directly predict the 55 dimension features. However, the quality is not as good as expected. Any suggestions about the predicted features ?

from lpcnet.

mrgloom avatar mrgloom commented on July 24, 2024

Is reference wav file is avalible to test preformance of master model? Does benchmarks should be runned using lpcnet_demo binary?

Also related #56

from lpcnet.

alokprasad avatar alokprasad commented on July 24, 2024

For me it took 6sec to convert from feature to wav for generating a wav ( audio file ) of 20sec. ?
it is expected or what numbers others are seeing.

from lpcnet.

SylviaZiyuZhang avatar SylviaZiyuZhang commented on July 24, 2024

For me it took 6sec to convert from feature to wav for generating a wav ( audio file ) of 20sec. ?
it is expected or what numbers others are seeing.

It's expected.

from lpcnet.

ZhaoZeqing avatar ZhaoZeqing commented on July 24, 2024

@jmvalin I use "./lpcnet_demo -synthesis x.lpc x.pcm" to generate wav from feature, but the speed is very slow, about 6sec to generate a 5sec wav, any suggestions about it? Thanks!

from lpcnet.

carlfm01 avatar carlfm01 commented on July 24, 2024

@ZhaoZeqing with AVX enabled?

from lpcnet.

ZhaoZeqing avatar ZhaoZeqing commented on July 24, 2024

@ZhaoZeqing with AVX enabled?

@carlfm01 It worked! Thanks!

from lpcnet.

xiaoyangnihao avatar xiaoyangnihao commented on July 24, 2024

@ZhaoZeqing with AVX enabled?

@carlfm01 It worked! Thanks!

how to get AVX enabled?

from lpcnet.

jmvalin avatar jmvalin commented on July 24, 2024

If your machine supports AVX, then just adding -march=native to the CFLAGS should be enough. See README.md for more on CFLAGS

from lpcnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.