feat: add TxtSlicesDataset to allow sampling slices from txt file for benchmarking#30156
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
💡 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".
|
This pull request has merge conflicts that must be resolved before it can be |
d1ba173 to
5c92be2
Compare
5c92be2 to
5e2e032
Compare
There was a problem hiding this comment.
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
5e2e032 to
615803d
Compare
|
Documentation preview: https://vllm--30156.org.readthedocs.build/en/30156/ |
|
Hi @hypdeb, the pre-commit checks have failed. Please run: uv pip install pre-commit
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
|
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 |
|
Cannot reproduce the documentation generation error locally. I get: |
|
Documentation preview: https://vllm--30156.org.readthedocs.build/en/30156/ |
|
This pull request has merge conflicts that must be resolved before it can be |
5a5e79d to
efba577
Compare
|
Hi @hypdeb, the pre-commit checks have failed. Please run: uv pip install pre-commit
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
1 similar comment
|
Hi @hypdeb, the pre-commit checks have failed. Please run: uv pip install pre-commit
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
4fb80eb to
db25703
Compare
|
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. |
|
Note that I wanted to make additional fixes to the typing in |
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>
1e747e2 to
63b4470
Compare
|
Okay, I have now addressed all review comments. |
… reverting changes made there Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: jdebache <jdebache@nvidia.com>
Signed-off-by: jdebache <jdebache@nvidia.com>
DarkLight1337
left a comment
There was a problem hiding this comment.
LGTM now, thanks for your patience!
|
Thanks for your thorough review! |
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com> Signed-off-by: zengxian <xiangdong.zeng@intel.com>
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com>
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com> Signed-off-by: Avinash Singh <avinashsingh.rcoem@gmail.com>
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com>
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com>
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com>
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com>
… benchmarking (vllm-project#30156) Signed-off-by: jdebache <jdebache@nvidia.com> Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
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
TxtSlicesDatasetwhich 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
TxtSlicesDatasetdatasets.py