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

Support benchmarking script by using real application trace #737

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

nwangfw
Copy link
Collaborator

@nwangfw nwangfw commented Feb 25, 2025

Pull Request Description

This PR adding benchmarking support by using real user application prompt traces in the heterogenous gpu story. This is a general benchmarking methods working for all models. It addresses the issue where the current fix benchmarking process may not be working for certain models or certain configuration settings (e.g., temperature)

Related Issues

Resolves: #722

Important: Before submitting, please complete the description above and review the checklist below.


Contribution Guidelines (Expand for Details)

We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:

Pull Request Title Format

Your PR title should start with one of these prefixes to indicate the nature of the change:

  • [Bug]: Corrections to existing functionality
  • [CI]: Changes to build process or CI pipeline
  • [Docs]: Updates or additions to documentation
  • [API]: Modifications to aibrix's API or interface
  • [CLI]: Changes or additions to the Command Line Interface
  • [Misc]: For changes not covered above (use sparingly)

Note: For changes spanning multiple categories, use multiple prefixes in order of importance.

Submission Checklist

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.

@nwangfw nwangfw force-pushed the ning/gpu-optimizer-benchmark-with-real-prompts branch 4 times, most recently from 42214fb to 4761e31 Compare February 25, 2025 06:37
@nwangfw nwangfw force-pushed the ning/gpu-optimizer-benchmark-with-real-prompts branch from 4761e31 to b02dabf Compare February 25, 2025 06:53
@nwangfw nwangfw changed the title [WIP] Support benchmarking script by using real application trace Support benchmarking script by using real application trace Feb 25, 2025
@nwangfw
Copy link
Collaborator Author

nwangfw commented Feb 25, 2025

@zhangjyr Can you help to review this PR? Thanks!

@nwangfw nwangfw requested review from zhangjyr and Jeffwan February 25, 2025 18:07
# Convert rate_start to integer (multiply by 100 and remove decimals)
req_rate=$(echo "$rate_start * 100" | bc | cut -d. -f1)
rate_limit_scaled=$(echo "$rate_limit * 100" | bc | cut -d. -f1)
while [[ $req_rate -le $rate_limit_scaled ]]; do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it because -le can compare integers only, so we need to *100? And I suppose 0.125 is also somehow supported (inaccurate is ok) by removing decimals? Just in case, I would suggest setting req_rate at least 0.01 to avoid 0.

Copy link
Collaborator Author

@nwangfw nwangfw Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, -le doesn't work for decimal numbers. I also modified the number to *1000 to support 0.125 case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment here to tell the maintainer why 1000 is necessary.

# synthetic_prompt = "hi " * config_input_len
# # assign timestamp to -1 for all requests
# requests.append((synthetic_prompt, config_input_len, config_output_len, -1))
return []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why comment on this part? If no workload is provided, the benchmark will not work without a synthetic prompt.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestions. I have updated the benchmarking logics after our discussion today. Now the benchmarking support using real prompts from dataset and synthetic prompt.

@nwangfw nwangfw force-pushed the ning/gpu-optimizer-benchmark-with-real-prompts branch 2 times, most recently from 6ee6873 to cb0255c Compare February 26, 2025 01:44
@nwangfw
Copy link
Collaborator Author

nwangfw commented Feb 26, 2025

@zhangjyr Your comments have been addressed. Please review again when you have a chance. Thanks!

@nwangfw nwangfw force-pushed the ning/gpu-optimizer-benchmark-with-real-prompts branch from cb0255c to 5c821ff Compare February 26, 2025 17:32
@nwangfw nwangfw force-pushed the ning/gpu-optimizer-benchmark-with-real-prompts branch from 5c821ff to 3db2882 Compare February 26, 2025 17:48
if [[ -z "$OUTPUT_FILE" ]]; then
OUTPUT_FILE="${PATH_PREFIX}/result/${MODEL}.jsonl"
fi
OUTPUT_FILE="${PATH_PREFIX}/result/${FILE_NAME}.jsonl"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, I don't think hardcoding all files being in ${PATH_PREFIX}/result/ is a good idea. In particular, python runtime is INSTALLED in a special folder if running as a docker, and it will become difficult to know where the output is. The same problem is true for PROMPT_DIR.

# Convert rate_start to integer (multiply by 100 and remove decimals)
req_rate=$(echo "$rate_start * 100" | bc | cut -d. -f1)
rate_limit_scaled=$(echo "$rate_limit * 100" | bc | cut -d. -f1)
while [[ $req_rate -le $rate_limit_scaled ]]; do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment here to tell the maintainer why 1000 is necessary.

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.

Improving benchmarking scripts with real prompts in heterogenous GPU story
3 participants