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

Marlin 24 prefill performance improvement (about 25% better on average) #4983

Merged
merged 9 commits into from
May 23, 2024

Conversation

alexm-redhat
Copy link
Collaborator

This PR introduces performance improvement to marlin_24's prefill (large batch) performance. The key fix is to ensure that the matmul instructions happen concurrently with the async global => shared memory load phase. Before that, the code was first waiting for the async stage to finish and only then ran the matmul, which reduces overlap of memory/compute and hurts compute-bound case/prefill.

Another fix is to introduce the 32/512 (k/n thread_block) configuration for high batch counts, since it reduces the amount of times we need to load matrix A (due to less tiling over N), and loading A is more expensive when we have larger batch.

@alexm-redhat alexm-redhat changed the title gptq_marlin_24 prefill performance improvement (about 25% better on average) Marlin 24 prefill performance improvement (about 25% better on average) May 22, 2024
@alexm-redhat alexm-redhat force-pushed the marlin_24_improve_prefill branch from 21454f5 to 13f0f79 Compare May 22, 2024 15:04
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.

Really clean work Alex, I appreciate this! The optimization makes sense and it's only a few more kernels to compile

Copy link
Collaborator

@pcmoritz pcmoritz left a comment

Choose a reason for hiding this comment

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

Nice, looks great!

@mgoin mgoin merged commit 6066253 into vllm-project:main May 23, 2024
63 checks passed
@mgoin mgoin deleted the marlin_24_improve_prefill branch May 23, 2024 06:39
dtrifiro pushed a commit to opendatahub-io/vllm that referenced this pull request May 31, 2024
robertgshaw2-redhat pushed a commit to neuralmagic/nm-vllm that referenced this pull request Jun 8, 2024
joerunde pushed a commit to joerunde/vllm that referenced this pull request Jun 17, 2024
Temirulan pushed a commit to Temirulan/vllm-whisper that referenced this pull request Sep 6, 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