[bugfix] fix bugs in vllm_v1_adapter.py and setup.py && format code#5
Merged
linhu-nv merged 2 commits intotaco-project:devfrom Sep 8, 2025
Merged
[bugfix] fix bugs in vllm_v1_adapter.py and setup.py && format code#5linhu-nv merged 2 commits intotaco-project:devfrom
linhu-nv merged 2 commits intotaco-project:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses bugs in the FlexKV integration setup and vLLM adapter by fixing path handling and string formatting issues. The changes improve robustness of the build configuration and resolve logging inconsistencies.
- Fixed path handling in setup.py to use absolute paths for include directories
- Corrected a mathematical calculation bug in token matching logic
- Standardized logging messages to remove unnecessary f-string formatting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| setup.py | Uses absolute path for include directories to ensure proper build configuration |
| flexkv/integration/vllm/vllm_v1_adapter.py | Fixes token calculation bug and removes unnecessary f-string formatting from log messages |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| """ | ||
| match_start_time = time.perf_counter() | ||
| num_tokens_to_get = (cdiv(request.num_prompt_tokens, self.block_size)-1)*self.block_size | ||
| num_tokens_to_get = (cdiv(request.num_prompt_tokens+1, self.block_size)-1)*self.block_size |
There was a problem hiding this comment.
[nitpick] The expression request.num_prompt_tokens+1 should have spaces around the + operator for better readability: request.num_prompt_tokens + 1.
Suggested change
| num_tokens_to_get = (cdiv(request.num_prompt_tokens+1, self.block_size)-1)*self.block_size | |
| num_tokens_to_get = (cdiv(request.num_prompt_tokens + 1, self.block_size)-1)*self.block_size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.