Skip to content

Conversation

@bigPYJ1151
Copy link
Member

This PR added FP8-E5M2 KV cache support for the CPU backend, and also updated tests for chunked-prefill with Half dtype.

Signed-off-by: jiang1.li <[email protected]>
Signed-off-by: jiang1.li <[email protected]>
@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 the documentation Improvements or additions to documentation label Mar 13, 2025
@DarkLight1337 DarkLight1337 requested review from Isotr0py and mgoin March 13, 2025 08:55
Copy link
Member

@Isotr0py Isotr0py left a comment

Choose a reason for hiding this comment

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

The added fp8 tests passed on my side locally, LGTM!

Comment on lines +70 to +71
if cache_config.cache_dtype == "fp8_e4m3":
cache_config.cache_dtype = "fp8_e5m2"
Copy link
Member

@Isotr0py Isotr0py Mar 13, 2025

Choose a reason for hiding this comment

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

Seems that chunked_prefill/prefix_caching doesn't work with fp8 kv_cache, perhaps add a check with better error message here?

[rank0]:   File "/data/develop-projects/github-repos/vllm-cpu/vllm/attention/backends/torch_sdpa.py", line 544, in forward
[rank0]:     ipex_modules.PagedAttention.flash_attn_varlen_func(
[rank0]:   File "/data/develop-projects/github-repos/vllm-cpu/.venv/lib/python3.12/site-packages/intel_extension_for_pytorch/llm/modules/mha_fusion.py", line 622, in flash_attn_varlen_func
[rank0]:     ).flash_attn_varlen_func(
[rank0]:       ^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/data/develop-projects/github-repos/vllm-cpu/.venv/lib/python3.12/site-packages/intel_extension_for_pytorch/transformers/models/cpu/fusions/mha_fusion.py", line 415, in flash_attn_varlen_func
[rank0]:     torch.ops.torch_ipex.flash_attn_varlen_func(
[rank0]:   File "/data/develop-projects/github-repos/vllm-cpu/.venv/lib/python3.12/site-packages/torch/_ops.py", line 1123, in __call__
[rank0]:     return self._op(*args, **(kwargs or {}))
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: RuntimeError: expected scalar type BFloat16 but found Float8_e5m2
Processed prompts:   0%|                                                                                         | 0/4 [00:00<?, ?it/s, est. speed input: 0.00 toks/s, output: 0.00 toks/s]

Signed-off-by: jiang1.li <[email protected]>
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) March 14, 2025 16:50
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 14, 2025
@vllm-bot vllm-bot merged commit a2ae496 into vllm-project:main Mar 15, 2025
66 of 71 checks passed
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
Signed-off-by: jiang1.li <[email protected]>
Signed-off-by: Louis Ulmer <[email protected]>
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 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 ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants