Kokoro-FastAPI icon indicating copy to clipboard operation
Kokoro-FastAPI copied to clipboard

Excuse me, how does this utilize FastAPI and other technologies to solve the Python Global Interpreter Lock (GIL) issue, and how can it achieve concurrency?

Open yourengod opened this issue 10 months ago • 3 comments

Excuse me, how does this utilize FastAPI and other technologies to solve the Python Global Interpreter Lock (GIL) issue, and how can it achieve concurrency?

yourengod avatar Mar 26 '25 09:03 yourengod

How is this an issue and it achieves concurrency because every request is run in a different thread ( this is default fast-api behaviour). As far as I know this does not solve GIL

fireblade2534 avatar Mar 26 '25 14:03 fireblade2534

How is this an issue and it achieves concurrency because every request is run in a different thread ( this is default fast-api behaviour). As far as I know this does not solve GIL

When the model runs on a GPU, it is a computational task. Since Python will not release the Global Interpreter Lock (GIL), it is not truly multithreaded. So, how can concurrency be achieved? Only in I/O-bound tasks will the GIL be released briefly, enabling a short-lived multithreading state.

yourengod avatar Mar 27 '25 00:03 yourengod

So that means the clients calling the fastapi are queued and processes one by one due to the GIL? If want to improve the performance for support massive clients call, what is the suggestion? Does this docker image support Python multiple process tech(i assume it's a solution)?

shaojun avatar Mar 30 '25 14:03 shaojun