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

Add batch mode to QueryPipeline #13203

Merged
merged 10 commits into from May 17, 2024
Merged

Add batch mode to QueryPipeline #13203

merged 10 commits into from May 17, 2024

Conversation

xpbowler
Copy link
Contributor

@xpbowler xpbowler commented May 1, 2024

Description

Add batch mode to QueryPipeline.

Added:

batch parameter to run, arun, _run, _arun, run_multi, arun_multi`

run_multi/arun_multi: Accepts inputs wrapped around in a List, List(Any) rather than List

  • New helper function merge_dicts that re-formats the batch output of these 2 functions
  • Uses list comprehension to generate individual inputs to _run_multi() (same as single input mode) from the batch input.

_run/_arun: Accepts inputs wrapped around in a List.

  • Uses list comprehension to generate individual inputs to _run_multi() (same as single input mode) from the batch input.

I didn't create a batch mode for the with_intermediates functions for now because I don't think its very useful. The list comprehension functions might be confusing tho. I think it might need some more work.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 1, 2024
@xpbowler
Copy link
Contributor Author

xpbowler commented May 7, 2024

@logan-markewich changed functions to run batch concurrently with async and validate that size of batch inputs are all the same.

@logan-markewich
Copy link
Collaborator

@xpbowler Ok, I think this is in decent shape! Do you want to add an example in the module_guides docs somewhere?

@xpbowler
Copy link
Contributor Author

@xpbowler Ok, I think this is in decent shape! Do you want to add an example in the module_guides docs somewhere?

updated docs! lmk how it is

@xpbowler
Copy link
Contributor Author

@logan-markewich hmm, some of the llama-index-integrations failed the unit test. I only changed the .md documentation since last time - did some requirements change?

@logan-markewich
Copy link
Collaborator

@xpbowler ah, there was some nasty CICD issues that I fixed on Monday. I'll merge main again and see if it works

@logan-markewich logan-markewich merged commit 01df13f into run-llama:main May 17, 2024
8 checks passed
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants