Skip to content

[MISC] Remove unused variableds in C++#19609

Merged
simon-mo merged 1 commit intovllm-project:mainfrom
houseroad:remove_unused
Jun 16, 2025
Merged

[MISC] Remove unused variableds in C++#19609
simon-mo merged 1 commit intovllm-project:mainfrom
houseroad:remove_unused

Conversation

@houseroad
Copy link
Collaborator

@houseroad houseroad commented Jun 13, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

Some C++ code contain unused definition / var. We used [[maybe_unused]] to mark them. Now clean up

Test Plan

AMD: build from scratch
Nvidia: build from scratch
Also CI

Test Result

AMD built successfully
Nvidia built successfully
CI built successfully.

(Optional) Documentation Update

N/A

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Summary of Changes

Hello @houseroad, 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 focuses on code hygiene by removing variables that were identified as unused and marked with the [[maybe_unused]] attribute. The changes span several core components including attention, quantization, and input preparation kernels, aiming to simplify the code and eliminate compiler warnings related to unused entities.

Highlights

  • Code Cleanup: Removed various unused variables across C++ and CUDA source files that were previously marked with the [[maybe_unused]] attribute.
  • Kernel Optimization: Cleaned up unused local and shared memory variables within attention, quantization, and input preparation kernels.
  • Template Update: Removed unused variables from a Python template file used to generate C++ quantization code.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and 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 to provide feedback.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify mergify bot added the rocm Related to AMD ROCm label Jun 13, 2025
@houseroad houseroad changed the title [MISC] Remove unused variableds in C++ [WIP][MISC] Remove unused variableds in C++ Jun 13, 2025
@houseroad houseroad marked this pull request as draft June 13, 2025 10:17
Copy link
Contributor

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

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 aims to clean up unused variables marked with [[maybe_unused]] in C++ code. While several cleanups are correct, there are a few critical issues in csrc/attention/paged_attention_v1.cu, csrc/attention/paged_attention_v2.cu, and csrc/quantization/machete/generate.py that will lead to compilation errors. These need to be addressed.

Additionally, the pull request title has a small typo: "variableds" should be "variables".

Signed-off-by: Lu Fang <lufang@fb.com>
@houseroad houseroad marked this pull request as ready for review June 13, 2025 10:30
@houseroad houseroad added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 13, 2025
@houseroad houseroad changed the title [WIP][MISC] Remove unused variableds in C++ [MISC] Remove unused variableds in C++ Jun 13, 2025
@houseroad
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

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

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 removes unused variables and definitions, improving code readability. Ensure Nvidia and CI tests are completed to verify the changes.

Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

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

LGTM thanks for cleanup cc @tlrmchlsmth

@houseroad houseroad enabled auto-merge (squash) June 13, 2025 14:28
Copy link
Collaborator

@LucasWilkinson LucasWilkinson left a comment

Choose a reason for hiding this comment

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

Thank you!!

Copy link
Collaborator

@hongxiayang hongxiayang left a comment

Choose a reason for hiding this comment

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

always good to clean up

@simon-mo simon-mo disabled auto-merge June 16, 2025 03:05
@simon-mo simon-mo merged commit c6703d1 into vllm-project:main Jun 16, 2025
106 of 108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants