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

Thread count increasing each request #76

Closed
d3nd3 opened this issue Jan 18, 2025 · 5 comments
Closed

Thread count increasing each request #76

d3nd3 opened this issue Jan 18, 2025 · 5 comments

Comments

@d3nd3
Copy link

d3nd3 commented Jan 18, 2025

Everytime a TTS request is performed, the thread count in system process is increased by 4.

Using ghcr.io/remsky/kokoro-fastapi-gpu:v0.1.0post1

So I had like 640 thread number there, after a larger period. Intuition tells me that is not normal.

Operating System: Kubuntu

===============
I assume this is unintended, although it doesn't consume more cpu I believe.

@remsky
Copy link
Owner

remsky commented Jan 18, 2025

Thanks for the catch. I did some work to improve the resource management and cleanup in the more recent branch which should stop that from happening,, but I'll add some additional monitoring to check.

@AngelescuFilip
Copy link

Hello, we tried to solve the issue.

This is what we did:

Modified the TTSGPUModel class to implement better thread management and resource cleanup after each TTS request. This should prevent the thread count from increasing with each request.

You can review changes in this commit: clarin-ebtio800090@0c6c029.

Caution

Disclaimer: The concept of solution was created by AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.

Latta AI seeks to solve problems in open source projects as part of its mission to support developers around the world. Learn more about our mission at https://latta.ai/ourmission . If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.

Are you sure your code works with the whole KokoroTTS FastAPI code, have you tested it ? it gives lots of errors when i try to implement it.

@fireblade2534
Copy link
Contributor

#87 might solve it @d3nd3

@d3nd3
Copy link
Author

d3nd3 commented Jan 22, 2025

@fireblade2534 Thanks, I tested latest build and it does fix it

@d3nd3 d3nd3 closed this as completed Jan 22, 2025
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

5 participants
@d3nd3 @remsky @fireblade2534 @AngelescuFilip and others