Custom bench metrics - #1009
Conversation
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
…nto decode_holdback Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
It seems that in some cases the request id that arrives at the input_batch for removal has never been seen by the input batch before. This could happen because of the cancellation of a request that was never scheduled. Also, it seems that in the ChunkedPrefillModelRunner we somehow forgot to remove requests from self.requests, so that "warmup-0" and other requests were accumulating forever. Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Decode pausing bench metrics
4a25cc1 to
72507da
Compare
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
|
|
||
| _original = OpenAIServingChat.chat_completion_stream_generator | ||
|
|
||
| async def _patched_generator(self, request, result_generator, request_id, *args, **kwargs): |
There was a problem hiding this comment.
these positional args are a bit fragile if upstream signature changes. Can we add a compat test to detect this?
There was a problem hiding this comment.
added some tests to catch upstream changes in CI
| else: | ||
| try: | ||
| candidates = [ | ||
| os.path.join(result_dir, f) | ||
| for f in os.listdir(result_dir) | ||
| if f.endswith(".json") | ||
| and os.path.getmtime(os.path.join(result_dir, f)) >= run_started_at | ||
| ] | ||
| except OSError: | ||
| candidates = [] |
There was a problem hiding this comment.
this seems risky. can we just always set an explicit_name?
There was a problem hiding this comment.
Now I force the user to set --result-dir and --result-filename whenever --save-result is set
| class _StdoutSplitter: | ||
| def write(self, s): | ||
| if not done["v"]: | ||
| if s.strip() == "=" * 50: |
There was a problem hiding this comment.
also risky if that formatting changes upstream. We could add an compat test to detect this too.
There was a problem hiding this comment.
Added a compat test so that if this changes in upstream, the CI will detect it
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com> Co-authored-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
fix ordering
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
|
Thanks for the review @yannicks1 I addressed your comments |
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
…seams in upstream compat suite Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
…start_times, and cover the reordering + sentinel-pad paths Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
Co-authored-by: Sophie du Couédic <sop@zurich.ibm.com> Signed-off-by: Yannick Schnider <Yannick.Schnider1@ibm.com>
Custom bench robustness
yannicks1
left a comment
There was a problem hiding this comment.
lgtm, thanks for this addition. will be very useful to get a better understanding of HW perf!
Description
This PR allows to run benchmarks with additional custom metrics in addition to the regular TTFT, ITL values. It patches
vllm benchto reuse the base implementation, but on top of it collects additional metrics such as the waiting time in the queue, or the waiting time in the queue or the number of chunked prefill count.Note: we can use the client patching to collect and print information from the SimModel in PR #990. Additionally the patching should also allow to inject real number of output tokens to SimModel (because as a sim model, it cannot by itself generate a realistic number of output tokens), enabling more realistic perf simulation without
--ignore-eosand--custom-output-len -1parameters.Contributions
sendnn-bench serveinstead ofvllm bench. We register a customspyre-chatbackend that collects per-request custom metrics from SSE responses, in addition to the existing ttft, itl valuesInjection of per-request sendnn results into the existing output JSON file created by
--save-detailedusing
--describe-metricsflag saves the sendnn metrics descriptions to asendnn_bench_metrics_description.txtfileDetailed
timeline.htmlwhich displays for each request the waiting time and individual chunked prefill times (instead of only the ttft), as well as waiting time of decodestest for the patching and metrics collection
A claude skill to easily add new metrics. The user has to give a detailed description of the new metric, how and where to compute the value, then the skill allows Claude to know all the places that require modifications for the new metric to appear in the .json output file and printed result. It also tells how to adapt the tests to integrate the new metrics. Examples:
Usage docs: https://vllm--1009.org.readthedocs.build/projects/spyre/en/1009/user_guide/detailed_performance_measurement.html
Usage
SENDNN_INFERENCE_BENCH_METRICS_ENABLED=1to indicate to the server to collect sendnn metrics, and also set the patchingsvllm serve {model} --max-model-len {model-len} --max-num-seqs {num_seqs}spyre-bench serve --model ibm-granite/granite-3.3-8b-instruct --save-result --describe-metrics ...Output:
Related Issues
None
Test Plan
Test the patching works correctly, that the metrics are saved to .json file correctly and also printed correctly
Checklist
bash format.sh)Signed-off-by:line (DCO compliance)