Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Purpose

This PR implements key enhancements to vllm bench sweep serve and plotting:

1. Fixed Boolean Nested Dot-Notation Parameters

  • Before: compilation_config.use_inductor_graph_partition: false--no-compilation-config.use_inductor_graph_partition
  • After: compilation_config.use_inductor_graph_partition: false--compilation-config.use_inductor_graph_partition=false

2. Fixed Nested Dictionary Values

  • Dict values properly JSON serialized instead of Python repr strings

3. Dict Format Support

  • Parameter files can now use dict format where keys are experiment names
  • Uses _benchmark_name field internally (not passed as CLI parameter)
  • Validates that all _benchmark_name values are unique

4. Enhanced Plot Options

  • --no-error-bars flag to disable error bars (default: enabled)
  • --fig-height to control subplot height in inches (default: 6.4)
  • --fig-dpi to control figure resolution (default: 300)
  • --fig-name parameter to customize figure prefix (default: "FIGURE")
  • Curve names are now alphabetically sorted in legends

5. Improved Data Handling

  • String values "inf", "-inf", and "nan" are automatically converted to floats when loading data

Backward Compatibility

✓ All changes are backward compatible - existing list format continues to work

Test Plan

# Run parameter sweep unit tests
pytest tests/benchmarks/test_param_sweep.py

# Run plot filter unit tests
pytest tests/benchmarks/test_plot_filters.py

# Test with example configs
vllm bench sweep serve \
  --serve-cmd "vllm serve meta-llama/Llama-3.2-1B-Instruct" \
  --bench-cmd "vllm bench serve --model meta-llama/Llama-3.2-1B-Instruct" \
  --serve-params serve_params_dict.json \
  --bench-params bench_params_dict.json \
  --dry-run

# Test custom figure options
vllm bench sweep plot results --fig-name custom_plot --fig-height 8 --fig-dpi 300 --no-error-bars

Test Result

All unit tests pass. Verified:

  • Nested boolean params generate correct =true/false syntax
  • Non-nested booleans still use --no- prefix (backward compatible)
  • Dict values properly JSON serialized with complex nested structures
  • Dict format loads and uses names in output paths
  • List format continues working unchanged
  • _benchmark_name uniqueness validation works correctly (raises ValueError on duplicates)
  • Plot filter tests validate all comparison operators work correctly
  • Figure naming, height, DPI, and error bar options work correctly
  • Curve names are alphabetically sorted in legends


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Fix boolean nested dot-notation params to use =true/false syntax
- Fix nested dict parameter values to be JSON serialized
- Add support for dict format in --bench-params and --serve-params
- Use name field from dict format as benchmark name

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
@mergify mergify bot added the performance Performance-related issues label Nov 19, 2025
The 'name' field is used for identification in dict format but should not be passed as a command-line parameter.

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for bench and serve params as dict Fix boolean nested params and add dict format support for vllm bench sweep serve Nov 19, 2025
Copilot AI requested a review from ProExpertProg November 19, 2025 19:00
Copy link
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

@ProExpertProg
Copy link
Collaborator

@copilot also use _benchmark_name to store the name instead of name, and assert they are all unique (if provided via the list of records format).

- Converted boolean and string/numeric tests to parametrized tests
- Simplified dict comprehension in read_from_dict
- Extracted normalize_cmd_kv_pair method
- Added name() method to ParameterSweepItem
- Updated serve.py to use name() method

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
@ProExpertProg
Copy link
Collaborator

@copilot also use _benchmark_name to store the name instead of name, and assert they are all unique (if provided via the list of records format).

- Changed field name from 'name' to '_benchmark_name' throughout codebase
- Added validation to ensure all _benchmark_name values are unique
- Updated name() method to use _benchmark_name
- Updated apply_to_cmd() and as_text() to skip _benchmark_name
- Added comprehensive tests for uniqueness validation
- Updated all existing tests to use _benchmark_name

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot also use _benchmark_name to store the name instead of name, and assert they are all unique (if provided via the list of records format).

Done in cb81309. Changed to use _benchmark_name and added validation to ensure all values are unique when provided via list or dict format. Duplicates now raise a descriptive ValueError.

Copy link
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

- Changed test_nested_dict_value to use compilation_config instead of env
- Made it parametrized with multiple field combinations
- Tests cudagraph_mode (full/piecewise), mode (2/3), use_inductor_graph_partition (True/False)

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Signed-off-by: Luka Govedič <luka.govedic@gmail.com>
Signed-off-by: Luka Govedič <luka.govedic@gmail.com>
@ProExpertProg
Copy link
Collaborator

@copilot add tests for filtering including the "inf" string edge case

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

})

# DataFrame with "inf" as string (edge case)
self.df_inf_string = pd.DataFrame({
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot remove the string test cases as we now coerce the inf/nan to float

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 59d9982. Removed the string test cases (df_inf_string, test_equal_to_inf_string, test_not_equal_to_inf_string, test_inf_string_mixed_dataframe) since inf/nan values are now coerced to floats when loading data.

… fig_height

- Removed try/except import guard for pytest and pandas in test_plot_filters.py
- Renamed fig_width to fig_height to correctly reflect that it controls
  the height parameter of seaborn's FacetGrid
- Updated help text from "Width" to "Height"

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Since inf/nan string values are now converted to floats when loading
data, the string-based test cases are no longer needed. Updated tests
to only use float('inf') and removed:
- df_inf_string DataFrame
- test_equal_to_inf_string
- test_not_equal_to_inf_string
- test_inf_string_mixed_dataframe

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Signed-off-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Copy link
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

- Refactored test_unique_benchmark_names_validation to use pytest.raises
- Refactored test_unique_benchmark_names_multiple_duplicates to use pytest.raises
- Cleaner and more idiomatic pytest error testing

Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Signed-off-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) December 2, 2025 04:51
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 2, 2025
Signed-off-by: Luka Govedič <luka.govedic@gmail.com>
@DarkLight1337 DarkLight1337 merged commit 1c593e1 into main Dec 2, 2025
48 checks passed
@DarkLight1337 DarkLight1337 deleted the copilot/add-bench-params-dict-support branch December 2, 2025 20:40
charlotte12l pushed a commit to charlotte12l/vllm that referenced this pull request Dec 5, 2025
…ing for vllm bench sweep (vllm-project#29025)

Signed-off-by: Luka Govedič <luka.govedic@gmail.com>
Signed-off-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Co-authored-by: Luka Govedič <luka.govedic@gmail.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
charlotte12l pushed a commit to charlotte12l/vllm that referenced this pull request Dec 9, 2025
…ing for vllm bench sweep (vllm-project#29025)

Signed-off-by: Luka Govedič <luka.govedic@gmail.com>
Signed-off-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ProExpertProg <11367180+ProExpertProg@users.noreply.github.com>
Co-authored-by: Luka Govedič <luka.govedic@gmail.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance-related issues ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants