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

[python] refactor input parser to support Request #2145

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

sindhuvahinis
Copy link
Contributor

@sindhuvahinis sindhuvahinis commented Jul 3, 2024

Description

Refactoring input parser to support Request. Before this PR, we loop through the list of requests to list of input_text, input_size, parameters etc.. and then in rolling batch, we loop through through these parsed list and then convert to list of requests Request again. This PR aims to avoid this duplicate work.

Assumptions

  1. Before this PR, we duplicated the parameters for client side batching, which is not needed anymore as we no longer maintain this as list, we maintan this a list of Requests.
  2. In this PR, we assume, if adapter_registry is non empty, then adapters needs to be looked in the requests. If adapter_registry is empty, then we dont look for adapters.
  3. In this PR, we introduced server_parameters => which will have the server modified parameters and the built-in handlers should look for this in order to modify or send to backend engines like vllm.

After this PR, for future improvements

  1. For the new standard of input_formatter, we would want request_input and part of the input_formatter. This refactor makes this easier.
  2. For mulitmodal parsing, this should also makes thing easier.
  3. output_formatter could be easily used by dynamic batching use cases as well. This will unify the API UX for rolling batch and dynamic batching.

Testing

P.S. I could not divide this into multiple PRs, sorry about that. All these changes has to go in one PR.

@sindhuvahinis sindhuvahinis requested review from zachgk, frankfliu and a team as code owners July 3, 2024 23:48
@sindhuvahinis sindhuvahinis marked this pull request as draft July 3, 2024 23:48
@sindhuvahinis sindhuvahinis force-pushed the ref branch 5 times, most recently from b3e3595 to 8bb2177 Compare July 8, 2024 22:14
@sindhuvahinis sindhuvahinis force-pushed the ref branch 2 times, most recently from 4110528 to dda1c0b Compare July 9, 2024 17:10
@sindhuvahinis sindhuvahinis marked this pull request as ready for review July 9, 2024 19:52
@sindhuvahinis sindhuvahinis merged commit b6bc5ca into deepjavalibrary:master Jul 9, 2024
9 checks passed
@sindhuvahinis sindhuvahinis deleted the ref branch July 10, 2024 19:06
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

Successfully merging this pull request may close these issues.

3 participants