Skip to content

Conversation

jinzhen-lin
Copy link
Contributor

@jinzhen-lin jinzhen-lin commented May 6, 2025

This PR adds nvfp4 support for marlin kernel, both dense and moe.

In addition to standard FP4 support, I fuse the floating-point operations in the dequantization process with the subsequent sub-zero-point and scaling steps to reduce kernel computation. This currently provides significant speedups for FP4/FP8 and modest acceleration for AWQ-INT4.

Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Copy link

github-actions bot commented May 6, 2025

👋 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.

🚀

Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
@mgoin
Copy link
Member

mgoin commented May 6, 2025

FYI @tms the wheel size only grows by 1 MB

Wheel dist/vllm-0.8.5.dev473+g6eae34533-cp38-abi3-linux_x86_64.whl is within the allowed size (317.64 MB).
vs
Wheel dist/vllm-0.8.5.dev483+g8392d7381-cp38-abi3-linux_x86_64.whl is within the allowed size (318.93 MB).

Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>

template <>
__device__ inline void dequant<nv_bfloat162, vllm::kU4.id()>(
__device__ inline void dequant<nv_bfloat162, vllm::kU4.id(), true>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! We can also start using these functions for the fp4 scaled_mm tests!

@mgoin mgoin added kernel ready ONLY add when PR is ready to merge/full CI is needed labels May 8, 2025
@mgoin
Copy link
Member

mgoin commented May 8, 2025

Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
jinzhen-lin added 16 commits May 9, 2025 11:56
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
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.

Excellent work here! I need to run another smoke test since the scales change to fp8, but I think this is all good to go

Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
@vllm-bot vllm-bot merged commit d74e5f3 into vllm-project:main May 11, 2025
87 of 90 checks passed
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
mawong-amd pushed a commit to ROCm/vllm that referenced this pull request May 14, 2025
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
zzzyq pushed a commit to zzzyq/vllm that referenced this pull request May 24, 2025
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: Yuqi Zhang <yuqizhang@google.com>
minpeter pushed a commit to minpeter/vllm that referenced this pull request Jun 24, 2025
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
Signed-off-by: minpeter <kali2005611@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build kernel 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.

4 participants