-
DescriptionOn the lecture of July 6th Sebastián was talking about FastAPI and ML models, and he said that is better to use Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
|
He recommended the use of If I understood correctly, I think he suggested running several processes in parallel for CPU intensive ML models, which would allow to generate several predictions at the same time for different requests. |
Beta Was this translation helpful? Give feedback.
-
|
Makes sense, thank you @rkbeatss |
Beta Was this translation helpful? Give feedback.
-
|
You can close the issue if you don't have other questions. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the help here @rkbeatss and @phy25 ! 👏 🙇 Thanks for reporting back and closing the issue @Kludex 👍 It's mainly because:
Ref: https://docs.python.org/3/library/asyncio-dev.html#running-blocking-code By using normal |
Beta Was this translation helpful? Give feedback.
-
|
Three years ago I asked this question because the operations were CPU bound, and running in a thread pool wasn't suppose to help... The link on the Python documentation shows to use an executor, but doesn't say which kind. The thing here is that the computations escape the GIL, and for that reason they can run in the thread executor. I didn't know about this at the time. |
Beta Was this translation helpful? Give feedback.
Three years ago I asked this question because the operations were CPU bound, and running in a thread pool wasn't suppose to help...
The link on the Python documentation shows to use an executor, but doesn't say which kind.
The thing here is that the computations escape the GIL, and for that reason they can run in the thread executor. I didn't know about this at the time.