-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Kernel] Use flashinfer for decoding #4353
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
bef3629
draft
LiuXiaoxuanPKU c1360e6
fix
LiuXiaoxuanPKU ad9189c
draft, pass simple decode tests
LiuXiaoxuanPKU 6b26d3b
minor
LiuXiaoxuanPKU e781798
remove attn backend interface change
LiuXiaoxuanPKU 5d469b7
basic test
LiuXiaoxuanPKU 308dd6c
Merge branch 'main' into flashinfer
LiuXiaoxuanPKU 883be3b
fix distributed tests
LiuXiaoxuanPKU aeda01e
Merge branch 'main' into flashinfer
LiuXiaoxuanPKU 7109622
try to fix ci
LiuXiaoxuanPKU ab00582
fix comments
5af4105
Merge branch 'main' into flashinfer
LiuXiaoxuanPKU 67fe4fd
typo
d48d25c
Merge branch 'flashinfer' of github.com:LiuXiaoxuanPKU/vllm into flas…
9ed5be0
raise exception for prefix caching
0ffddd7
try requirements
7f261df
manual install flashinfer
5b7f029
change dockerfile package
470df94
remove test
46ccb63
remove flashinfer from docker
14f7cef
revert docker change
e5245c0
fix comments and import error
11da264
Merge branch 'main' into flashinfer
fb7615d
minor
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| MODELS = [ | ||
| os.environ["TEST_DIST_MODEL"], | ||
| ] | ||
| VLLM_ATTENTION_BACKEND = "VLLM_ATTENTION_BACKEND" | ||
|
|
||
|
|
||
| @pytest.mark.skipif(torch.cuda.device_count() < 2, | ||
|
|
@@ -33,16 +34,19 @@ def test_models( | |
| dtype: str, | ||
| max_tokens: int, | ||
| ) -> None: | ||
| enforce_eager = False | ||
| backend_by_env_var = os.getenv(VLLM_ATTENTION_BACKEND) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (can do in future PR): we should integrate this with #4548 |
||
| if backend_by_env_var == "FLASHINFER": | ||
| enforce_eager = True | ||
|
|
||
| hf_model = hf_runner(model, dtype=dtype) | ||
| hf_outputs = hf_model.generate_greedy(example_prompts, max_tokens) | ||
| del hf_model | ||
|
|
||
| vllm_model = vllm_runner( | ||
| model, | ||
| dtype=dtype, | ||
| tensor_parallel_size=2, | ||
| ) | ||
| vllm_model = vllm_runner(model, | ||
| dtype=dtype, | ||
| tensor_parallel_size=2, | ||
| enforce_eager=enforce_eager) | ||
| vllm_outputs = vllm_model.generate_greedy(example_prompts, max_tokens) | ||
| del vllm_model | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,14 @@ | ||
| import pytest | ||
|
|
||
| from vllm.utils import create_kv_caches_with_random | ||
| from vllm.utils import (create_kv_caches_with_random, | ||
| create_kv_caches_with_random_flash) | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def kv_cache_factory(): | ||
| return create_kv_caches_with_random | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def kv_cache_factory_flashinfer(): | ||
| return create_kv_caches_with_random_flash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.