Conversation
Summary of ChangesHello @hnyls2002, 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 primarily focuses on enhancing the consistency of module naming within the project's speculative decoding components. By renaming 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 refactors the codebase by renaming ngram_utils.py to ngram_info.py for better consistency with other modules. The changes correctly update all import paths in the modified files. I also noticed the removal of an unused os import, which is a good cleanup. My main feedback is about a recurring typo (retrive instead of retrieve) in the renamed module and related components. While fixing this is likely out of scope for this PR, I've added comments to highlight this for a follow-up, as it affects code clarity and maintainability.
|
|
||
| elif self.model_runner.spec_algorithm.is_ngram(): | ||
| from sglang.srt.speculative.ngram_utils import NgramVerifyInput | ||
| from sglang.srt.speculative.ngram_info import NgramVerifyInput |
There was a problem hiding this comment.
While this renaming is a good step for consistency, I noticed a recurring typo in the newly named ngram_info module. The NgramVerifyInput class and its usage consistently use retrive instead of retrieve (e.g., retrive_index). This typo seems to be present in other parts of the codebase as well, including the underlying C++ kernels. It would be beneficial to create a follow-up task to correct this typo across the project for improved code clarity and maintainability.
| from sglang.srt.server_args import ServerArgs | ||
| from sglang.srt.speculative.cpp_ngram.ngram_cache import NgramCache | ||
| from sglang.srt.speculative.ngram_utils import NgramVerifyInput | ||
| from sglang.srt.speculative.ngram_info import NgramVerifyInput |
There was a problem hiding this comment.
The imported NgramVerifyInput from the renamed ngram_info module contains the retrive vs retrieve typo. This typo is also present within the NGRAMWorker class itself in variables like self.retrive_next_token and self.retrive_next_sibling. Correcting these typos in a follow-up PR would improve overall code quality.
For better consistency with
spec_utilsandeagle_info.