-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[Serve] Make max_batch_size
and batch_wait_timeout_s
reconfigurable
#36881
[Serve] Make max_batch_size
and batch_wait_timeout_s
reconfigurable
#36881
Conversation
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@edoakes the code changes are ready for review. I'm planning on adding doc changes to this PR soon. |
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@edoakes I've added documentation. This PR is ready for review end-to-end. |
max_batch_size
and batch_wait_timeout_s
reconfigurablemax_batch_size
and batch_wait_timeout_s
reconfigurable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shrekris-anyscale can you add a sentence to the @serve.batch
docstring mentioning the setters?
Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com> Signed-off-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@edoakes Thanks, I updated the docstring. Please take a look. |
Co-authored-by: angelinalg <122562471+angelinalg@users.noreply.github.com> Signed-off-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
…ray into create_batch_updaters
…le (ray-project#36881) The `@serve.batch` decorator has two parameters: `max_batch_size` and `batch_wait_timeout_s`. These parameters can be set in the decorator. However, they cannot be reconfigured after the Serve application starts. This change adds two setter methods: `set_max_batch_size` and `set_batch_wait_timeout_s`. Users can reconfigure their `@serve.batch` parameters using these methods: ```python @serve.batch(max_batch_size=1, batch_wait_timeout_s=0.1) def batch_handler(self, request_list): ... self.batch_handler.set_max_batch_size(5) self.batch_handler.set_batch_wait_timeout_s(0.5) ``` Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com> Co-authored-by: angelinalg <122562471+angelinalg@users.noreply.github.com> Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
Why are these changes needed?
The
@serve.batch
decorator has two parameters:max_batch_size
andbatch_wait_timeout_s
. These parameters can be set in the decorator. However, they cannot be reconfigured after the Serve application starts.This change adds two setter methods:
set_max_batch_size
andset_batch_wait_timeout_s
. Users can reconfigure their@serve.batch
parameters using these methods:Related issue number
Closes #36844
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.test_batching.py
.