Add routing microbenchmark for choose_replica + dispatch pattern#63293
Conversation
|
Kicking off release tests to populate data to verify databricks query. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new benchmarking mode, 'choose_dispatch', to evaluate the latency of the choose_replica and dispatch pattern in Ray Serve. The changes include adding a new benchmarking method to the Benchmarker class, updating the handle_noop_latency script with a new CLI option, and expanding the microbenchmark workloads to include this new mode. A review comment suggests refactoring the run_latency_benchmark method to avoid duplicating the definition of the internal benchmark function, which would improve code maintainability.
| if mode == "remote": | ||
|
|
||
| async def f(): | ||
| await self.do_single_request(payload) | ||
|
|
||
| elif mode == "choose_dispatch": | ||
|
|
||
| async def f(): | ||
| await self.do_single_choose_dispatch(payload) | ||
|
|
||
| else: | ||
| raise ValueError(f"Unknown mode {mode!r}") |
There was a problem hiding this comment.
The current implementation defines the local function f twice within different branches of the if statement. This logic can be refactored to be more concise and maintainable by assigning the target method to a variable first, and then defining f once.
if mode == "remote":
func = self.do_single_request
elif mode == "choose_dispatch":
func = self.do_single_choose_dispatch
else:
raise ValueError(f"Unknown mode {mode!r}")
async def f():
await func(payload)Signed-off-by: Jeffrey Wang <jeffreywang@anyscale.com>
4ae7060 to
7da35fb
Compare
Description
Following up on #63255 (comment), we'd like to show the delta between
choose_replica + dispatchandremotein our DB dashboards.Release test results -- latencies in ms (https://buildkite.com/ray-project/release/builds/92517/canvas?sid=019e1a3c-642f-4a42-867b-2818577272b6&tab=output)
remotechoose_replica + dispatchRelated issues
Additional information