Skip to content
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

fix block-size description #10938

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

chenqianfzh
Copy link
Contributor

@chenqianfzh chenqianfzh commented Dec 6, 2024

Per vllm official doc in https://docs.vllm.ai/en/stable/models/engine_args.html, the parameter of --block-size can take the value of {8,16,32,64,128}. However, I hit error "RuntimeError: Unsupported block size: 128" when I tried out "--block-size 128"

I hunted the code and saw the following logic in csrc/attention/paged_attention_v2.cu:

#define CALL_V2_LAUNCHER_BLOCK_SIZE(T, CACHE_T, KV_DTYPE)         \
  switch (block_size) {                                           \
    case 8:                                                       \
      CALL_V2_LAUNCHER_SPARSITY(T, CACHE_T, 8, KV_DTYPE);         \
      break;                                                      \
    case 16:                                                      \
      CALL_V2_LAUNCHER_SPARSITY(T, CACHE_T, 16, KV_DTYPE);        \
      break;                                                      \
    case 32:                                                      \
      CALL_V2_LAUNCHER_SPARSITY(T, CACHE_T, 32, KV_DTYPE);        \
      break;                                                      \
    default:                                                      \
      TORCH_CHECK(false, "Unsupported block size: ", block_size); \
      break;                                                      \
  }

Similar logic is also seen in csrc/attention/paged_attention_v1.cu.

Updated the parameter allowed value per the real logic.

Copy link

github-actions bot commented Dec 6, 2024

👋 Hi! Thank you for contributing to the vLLM project.
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 do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@simon-mo simon-mo merged commit 69ba344 into vllm-project:main Dec 16, 2024
20 of 24 checks passed
jikunshang added a commit to jikunshang/vllm that referenced this pull request Dec 17, 2024
@kzawora-intel
Copy link
Contributor

kzawora-intel commented Dec 17, 2024

Hey, while GPU kernels might not support block sizes greater than 32, other accelerators do. On HPU, going below block size 128 is very detrimental to performance. I don't think the option to use greater block sizes should be removed, rather a proper assertion and log should be added to verify_args. I've created PR #11259 reverting this one.

kzawora-intel added a commit to kzawora-intel/vllm-fork that referenced this pull request Dec 17, 2024
kzawora-intel added a commit to kzawora-intel/vllm-fork that referenced this pull request Dec 17, 2024
This reverts commit 69ba344.

Signed-off-by: Konrad Zawora <kzawora@habana.ai>
@chenqianfzh
Copy link
Contributor Author

Hey, while GPU kernels might not support block sizes greater than 32, other accelerators do. On HPU, going below block size 128 is very detrimental to performance. I don't think the option to use greater block sizes should be removed, rather a proper assertion and log should be added to verify_args. I've created PR #11259 reverting this one.

Thanks!

jikunshang added a commit to jikunshang/vllm that referenced this pull request Dec 18, 2024
BKitor pushed a commit to BKitor/vllm that referenced this pull request Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants