Conversation
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
Summary of ChangesHello @arekay-nv, 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 integrates a Highlights
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
|
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
Summary of ChangesHello @arekay-nv, 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 introduces a new Highlights
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
|
Summary of ChangesHello @arekay-nv, 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 introduces a new Highlights
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 a RandomDataLoader for generating arbitrary sequences, which is useful for testing. The implementation is a good start, but I've identified a few areas for improvement. My feedback includes fixing a potential TypeError from a float being passed to an integer-expecting function, resolving an inconsistency in vocabulary size usage, making the tokenizer a required argument, removing redundant code, and improving the new tests for clarity and robustness. I've also suggested adding docstrings to improve maintainability.
There was a problem hiding this comment.
Code Review
This pull request introduces a RandomDataLoader for generating test data. The implementation is a good start, but there are several areas for improvement regarding correctness, consistency, and code clarity. My review includes suggestions to handle vocabulary size consistently, fix a bug in random number generation, improve constructor logic, and align the implementation with the base class API contract. I've also provided feedback on the accompanying tests to make them more robust and less dependent on external services.
| assert index < self.num_samples(), "Index is out of range." | ||
| return self.data[index] |
There was a problem hiding this comment.
Using assert for index validation in a public method is not ideal as assertions can be disabled with the -O flag. To conform with the base class DataLoader's contract, which implies raising IndexError for out-of-bounds access, it's better to perform an explicit check and raise an IndexError.
| assert index < self.num_samples(), "Index is out of range." | |
| return self.data[index] | |
| if not (0 <= index < self.num_samples()): | |
| raise IndexError("Index is out of range.") | |
| return self.data[index] |
There was a problem hiding this comment.
Code Review
This pull request introduces a RandomDataLoader, which is a useful addition for testing purposes. The implementation is solid, but I've identified a few areas for improvement to enhance correctness and clarity. My main feedback revolves around an inconsistency in using vocab_size, which could lead to bugs. I suggest removing the vocab_size parameter and consistently using tokenizer.vocab_size. I've also pointed out some minor issues in the __init__ method and opportunities to improve variable naming for clarity. Finally, I've suggested updates to the tests to align with these changes and improve maintainability by removing magic numbers.
| self.num_sequences, | ||
| ) | ||
| # Generate the input starts randomly from the vocab size | ||
| input_starts = self.rng.integers( |
There was a problem hiding this comment.
I assume we would like reuse semi-analysis's random dataset as is? I would recommend properly quoting from (and add attribution) vLLM's benchmark_serving scripts (FYI this is from a fork): https://github.com/kimbochen/bench_serving/blob/499c0b171b499b02a1fd546fb2326d2175a5d66e/benchmark_serving.py#L366 so we have parity
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
Adds a random data loader that can generate arbitrary sequences of a given length. Useful for testing behavior over fixed sequence lengths.
Type of change
Related issues
Testing
Checklist