[diffusion] benchmark: Add SLO metric for SGL-Diffusion#18907
[diffusion] benchmark: Add SLO metric for SGL-Diffusion#18907yyy1000 wants to merge 7 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello @yyy1000, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces SLO (Service Level Objective) metrics to the multimodal serving benchmark. The changes include adding new command-line arguments for SLO configuration, implementing logic for warmup runs to establish a baseline latency, calculating expected latencies for requests, and reporting SLO attainment rates. The overall implementation is well-structured. I've provided a few suggestions to improve maintainability and conciseness by reducing code duplication and simplifying some conditional logic. Please take a look at the detailed comments.
| frame_scale = frames if isinstance(frames, int) and frames > 0 else 1 | ||
| step_scale = steps if isinstance(steps, int) and steps > 0 else 1 | ||
|
|
||
| area_units = max((float(width) * float(height)) / float(16 * 16), 1.0) |
There was a problem hiding this comment.
| if input.slo_ms is not None and output.success: | ||
| output.slo_achieved = (output.latency * 1000.0) <= input.slo_ms |
There was a problem hiding this comment.
This SLO check logic is identical to the one in async_request_image_sglang (lines 526-527). To avoid code duplication and improve maintainability, consider extracting this logic into a small helper function. For example, a function like _update_slo_achievement(input: RequestFuncInput, output: RequestFuncOutput) could be defined and called from both places.
|
My past dev machine doesn't have quota now and I'm planning to rent a new one to test this PR. |
|
Hi @yyy1000, thanks for your contribution! Please:
|
|
Hi @ping1jing2 , thank you so much for the review! I have done 1 & 2 and due to lack of personal GPU machine, I can't run the benchmark test right now but will figure out a way to do it soon. |
please let me know after your PR is ready for review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Hi @ping1jing2 , thanks for the note and I have uploaded the test result into the PR description and could you help review it again? Thank you! |
|
Hi @ping1jing2 , the PR is ready to review now, thanks! |
|
Hi @ping1jing2 , thank you for your review and I have resolved your comments. Could you review again when you're available and let me know what should I fix, thank you! |
| help="Number of warmup requests to run before measurement.", | ||
| ) | ||
| parser.add_argument( | ||
| "--warmup-num-inference-steps", |
There was a problem hiding this comment.
this should always be 1, iiuc
There was a problem hiding this comment.
Thank you for the review, and I just checked the server set warmup-inference-step to 1 so this should be 1 too and I made the change.
|
/tag-and-rerun-ci |
1 similar comment
|
/tag-and-rerun-ci |
Motivation
Closes #18722
Modifications
add slo metrics in SGL-diffusion bench_serving.py
Accuracy Tests
N/A
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci