Skip to content

feat: add TxtSlicesDataset to allow sampling slices from txt file for benchmarking#30156

Merged
DarkLight1337 merged 10 commits into
vllm-project:mainfrom
jdebache:datasets_refactor
Apr 14, 2026
Merged

feat: add TxtSlicesDataset to allow sampling slices from txt file for benchmarking#30156
DarkLight1337 merged 10 commits into
vllm-project:mainfrom
jdebache:datasets_refactor

Conversation

@jdebache

@jdebache jdebache commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Purpose

Sampling randomly directly from a tokenizer for benchmarking creates data that is not ideal to benchmark when using speculative decoding or expert parallelism.

On the other hand, random datasets are very flexible and offer complete control on the input and output sequence lengths, which is desirable to create reproducible benchmarks.

This PR introduces a new type of benchmarking dataset called TxtSlicesDataset which offers a compromise between the flexibility of a random dataset and the fidelity of a real dataset. It allows sampling slices from a user-provided txt file.

Content

  • The implementation of TxtSlicesDataset
  • Fixes to typing in datasets.py
  • A unit test for the new dataset type

@mergify mergify Bot added the performance Performance-related issues label Dec 5, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces TxtSlicesDataset for benchmarking, which samples data from a text file. It also includes significant refactoring by moving utility functions from datasets.py to a new dataset_utils.py file and improving typing throughout. The changes are well-structured. My review focuses on improving the robustness and reproducibility of the new TxtSlicesDataset and its tests. I've pointed out a resource leak in the tests and potential for non-reproducible behavior due to the use of the global random module. I've also identified a missing check that could lead to a crash with certain input files.

Comment thread tests/benchmarks/test_txt_slices_dataset.py Outdated
Comment thread vllm/benchmarks/datasets.py Outdated
Comment thread vllm/benchmarks/datasets.py Outdated
Comment thread vllm/benchmarks/datasets.py Outdated

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

Copy link
Copy Markdown

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".

Comment thread vllm/benchmarks/datasets.py Outdated
@mergify

mergify Bot commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hypdeb.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Comment thread vllm/benchmarks/datasets/datasets.py
Comment thread vllm/benchmarks/datasets/datasets.py
Comment thread vllm/benchmarks/datasets/datasets.py
Comment thread vllm/benchmarks/datasets.py Outdated
@jdebache jdebache requested a review from hmellor as a code owner January 27, 2026 13:48
@mergify

mergify Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--30156.org.readthedocs.build/en/30156/

@mergify mergify Bot added the documentation Improvements or additions to documentation label Jan 27, 2026
@mergify

mergify Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Hi @hypdeb, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

@jdebache

jdebache commented Jan 27, 2026

Copy link
Copy Markdown
Contributor Author

Hey, I'm trying to run the doc generation locally to figure out what is wrong. How long is it supposed to take?

I still can't reproduce locally, but from the error logs, it looks like it's trying to mock vllm over and over again for some reason.

@jdebache

Copy link
Copy Markdown
Contributor Author

Cannot reproduce the documentation generation error locally. I get:

INFO    -  Doc file 'features/spec_decode.md' contains an unrecognized relative link '../../tests/spec_decode/e2e', it was left as is.
INFO    -  Doc file 'design/fused_moe_modular_kernel.md' contains a link './moe_kernel_features.md#fused-moe-experts-kernels', but the doc 'design/moe_kernel_features.md' does not contain an anchor '#fused-moe-experts-kernels'.
INFO    -  Doc file 'getting_started/installation/README.md' contains a link 'gpu.md#nvidia-cuda', but the doc 'getting_started/installation/gpu.md' does not contain an anchor '#nvidia-cuda'.
INFO    -  Doc file 'getting_started/installation/README.md' contains a link 'gpu.md#amd-rocm', but the doc 'getting_started/installation/gpu.md' does not contain an anchor '#amd-rocm'.
INFO    -  Doc file 'getting_started/installation/README.md' contains a link 'gpu.md#intel-xpu', but the doc 'getting_started/installation/gpu.md' does not contain an anchor '#intel-xpu'.
INFO    -  Doc file 'getting_started/installation/README.md' contains a link 'cpu.md#intelamd-x86', but the doc 'getting_started/installation/cpu.md' does not contain an anchor '#intelamd-x86'.
INFO    -  Doc file 'getting_started/installation/README.md' contains a link 'cpu.md#arm-aarch64', but the doc 'getting_started/installation/cpu.md' does not contain an anchor '#arm-aarch64'.
INFO    -  Doc file 'getting_started/installation/README.md' contains a link 'cpu.md#apple-silicon', but the doc 'getting_started/installation/cpu.md' does not contain an anchor '#apple-silicon'.
INFO    -  Doc file 'getting_started/installation/README.md' contains a link 'cpu.md#ibm-z-s390x', but the doc 'getting_started/installation/cpu.md' does not contain an anchor '#ibm-z-s390x'.

Aborted with 7 warnings in strict mode!
sys:1: DeprecationWarning: builtin type swigvarlink has no __module__ attribute

@mergify

mergify Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--30156.org.readthedocs.build/en/30156/

@mergify

mergify Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hypdeb.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify

mergify Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Hi @hypdeb, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

1 similar comment
@mergify

mergify Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Hi @hypdeb, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

@jdebache jdebache force-pushed the datasets_refactor branch 2 times, most recently from 4fb80eb to db25703 Compare January 29, 2026 07:56
@jdebache

Copy link
Copy Markdown
Contributor Author

Hey @hmellor, would you mind having a look? We found this dataset generation useful while benchmarking with features that are data dependent such as EP and speculative decoding.

@jdebache

Copy link
Copy Markdown
Contributor Author

Note that I wanted to make additional fixes to the typing in datasets.py, however, it caused a cascade of issues, in particular in the documentation generator. Keeping those would have made the changes too large.

Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: jdebache <jdebache@nvidia.com>
@jdebache jdebache force-pushed the datasets_refactor branch from 1e747e2 to 63b4470 Compare April 14, 2026 07:08
@jdebache

Copy link
Copy Markdown
Contributor Author

Okay, I have now addressed all review comments.

Comment thread vllm/benchmarks/datasets/utils.py
Comment thread vllm/benchmarks/throughput.py Outdated
… reverting changes made there

Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: jdebache <jdebache@nvidia.com>
Comment thread vllm/benchmarks/datasets/datasets.py Outdated
Signed-off-by: jdebache <jdebache@nvidia.com>

@DarkLight1337 DarkLight1337 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM now, thanks for your patience!

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) April 14, 2026 07:54
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Apr 14, 2026
@jdebache

Copy link
Copy Markdown
Contributor Author

Thanks for your thorough review!

@DarkLight1337 DarkLight1337 merged commit 893b2af into vllm-project:main Apr 14, 2026
49 of 50 checks passed
zxd1997066 pushed a commit to zxd1997066/vllm that referenced this pull request Apr 15, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: zengxian <xiangdong.zeng@intel.com>
whk-lab pushed a commit to whk-lab/vllm that referenced this pull request Apr 23, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
avinashsingh77 pushed a commit to avinashsingh77/vllm that referenced this pull request Apr 27, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: Avinash Singh <avinashsingh.rcoem@gmail.com>
mystous pushed a commit to mystous/vllm_hybrid that referenced this pull request May 10, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request May 15, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request May 15, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
jhu960213 pushed a commit to jhu960213/vllm that referenced this pull request May 20, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
mvanhorn pushed a commit to mvanhorn/vllm that referenced this pull request Jun 4, 2026
… benchmarking (vllm-project#30156)

Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation frontend 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