-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature: batched execution #1589
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
Feature: batched execution #1589
Conversation
|
thanks a lot for this 🔥 - this was something that I was hoping to get to at some point in time and I see that the implementation is very clean as well do give me 2 days to test and review this and we'll get it out before the next release 🙂 |
|
The most recent PR makes it cleaner, and I think resolves the progress bar ordering issue. Part of the issue seems to be that it requires ipywidgets for improved rendering in when using jupyter notebooks or when running .py files with interactive cells; I don't know if that'd be worth a call out somewhere? |
|
thanks a lot as always @ahgraber ❤️ 🙂 |
Provides batched execution support for
ragas.executor.Executorandragas.async_utils.run_async_tasks.This is useful, for example, for folks who are self-hosting their own models and therefore don't have the throughput that a model service has. In this circumstance, sending a long list of task to the Executor would previously result in timeouts as all
ntasks were activated at the same time, but the LLM responses were queued.The batched approach only "activates"
batch_sizeof the coroutines, and then waits until that batch has been completed before moving on.Batching may result in slower/longer execution times with LLM APIs, but is disabled by default with
batch_size=None.Note:
tqdmsupport is a bit weird, and I haven't been able to resolve after spending about a day and a half on it, so I'm giving up / forcingleave=True.tqdm'spositionkwarg, so the inner progress bar gets overwritten by the other loop's whenleave=Falseleave=Trueonce the cursor drops to the next line for the next batch