Skip to content

[CI] change spell checker from codespell to typos #18711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andyxning
Copy link
Contributor

Currently, codespell can not help in finding all possible typos. According to this comparison, it seems typos has more good performance and correctness. typos also supports both pre-commit and 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.

🚀

@mergify mergify bot added documentation Improvements or additions to documentation frontend multi-modality Related to multi-modality (#4194) speculative-decoding v1 tpu Related to Google TPUs tool-calling labels May 26, 2025
@andyxning andyxning force-pushed the change_spell_checker_from_codespell_to_typos branch from 9e8461d to 2fb888e Compare May 26, 2025 12:55
Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

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

Overall this looks reasonable to me. Can you remove the codespell config from pyproject.toml?

@DarkLight1337
Copy link
Member

@mgoin can you verify that the changes to the kernels are OK?

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.

Please revert the changes to cudaDevAttrMaxSharedMemoryPerBlockOptin and the transformers test

I don't know if I like this. I think it will be annoying and error-prone if developers need to define functional exceptions like this during their work

attribute = cudaDevAttrMaxSharedMemoryPerBlockOptin;
attribute = cudaDevAttrMaxSharedMemoryPerBlockOption;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is valid. I think Optin is right here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems cudaDevAttrMaxSharedMemoryPerBlockOptin is predefined in cuda sdk. Will do.

@@ -18,7 +18,7 @@
inline int get_cuda_max_shared_memory_per_block_opt_in(int const device) {
int max_shared_mem_per_block_opt_in = 0;
cudaDeviceGetAttribute(&max_shared_mem_per_block_opt_in,
cudaDevAttrMaxSharedMemoryPerBlockOptin, device);
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -584,7 +584,7 @@ void marlin_mm(const void* A, const void* B, void* C, void* C_tmp, void* s,

int max_shared_mem = 0;
cudaDeviceGetAttribute(&max_shared_mem,
cudaDevAttrMaxSharedMemoryPerBlockOptin, dev);
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -302,7 +302,7 @@ void moe_align_block_size(torch::Tensor topk_ids, int64_t num_experts,
int device_max_shared_mem;
auto dev = topk_ids.get_device();
cudaDeviceGetAttribute(&device_max_shared_mem,
cudaDevAttrMaxSharedMemoryPerBlockOptin, dev);
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@andyxning andyxning force-pushed the change_spell_checker_from_codespell_to_typos branch from 2fb888e to 9e2ee0b Compare May 26, 2025 15:47
@andyxning andyxning requested a review from simon-mo as a code owner May 26, 2025 15:47
@andyxning andyxning force-pushed the change_spell_checker_from_codespell_to_typos branch from 9e2ee0b to d592a3e Compare May 26, 2025 15:53
@andyxning
Copy link
Contributor Author

Overall this looks reasonable to me. Can you remove the codespell config from pyproject.toml?

@DarkLight1337 Done.

@andyxning
Copy link
Contributor Author

I think it will be annoying and error-prone if developers need to define functional exceptions like this during their work

Yes. this is true. Some trade-off needs to be done if we decide to apply this PR.

@andyxning andyxning force-pushed the change_spell_checker_from_codespell_to_typos branch from d592a3e to ccd6843 Compare May 26, 2025 16:10
Copy link

mergify bot commented May 26, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @andyxning.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label May 26, 2025
Copy link
Member

Choose a reason for hiding this comment

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

Can you fix this? Maybe we can disable renaming files entirely

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mgoin file name spelling check has been disabled by setting check-filename to false in typos.yaml file.

@andyxning andyxning force-pushed the change_spell_checker_from_codespell_to_typos branch from ccd6843 to e87514b Compare May 27, 2025 02:37
@mergify mergify bot removed the needs-rebase label May 27, 2025
@andyxning andyxning force-pushed the change_spell_checker_from_codespell_to_typos branch from e87514b to 5ef5dab Compare May 27, 2025 02:40
Signed-off-by: Andy Xie <andy.xning@gmail.com>
@andyxning andyxning force-pushed the change_spell_checker_from_codespell_to_typos branch from 5ef5dab to 0b52b3e Compare May 27, 2025 02:47
@andyxning
Copy link
Contributor Author

andyxning commented May 27, 2025

It seems that most special escapes in spell checking are about cuda and nvml.

https://github.com/vllm-project/vllm/pull/18711/files#diff-51afc5d77bc899fd07f13239bccc4c8042af7062b994c4ce493d8123f905f5a4R21-R48

Other changes in this PR are clean and clear enough. There are two options about this spell check change to the later developing overhead:

  1. ignore checking all the c++ and nvml related files. This should make most special escapes deleted and has the lowest overhead for developing the project laterly.
  2. keep current special escapes and make them maintained as needed in the later developing phase. This will involve some manual operations, but since the codebase has been analysed and most special escapes has been discovered, the manual operations overhead depends on the develop frequencies in cuda and nvml related code. This should be not so much, imho. Correct me if i am wrong.

So, i prefer option 2.

/cc @mgoin

@andyxning andyxning requested review from DarkLight1337 and mgoin May 27, 2025 04:06
Copy link

mergify bot commented May 31, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @andyxning.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation frontend multi-modality Related to multi-modality (#4194) needs-rebase speculative-decoding tool-calling tpu Related to Google TPUs v1
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants