Repository navigation
[Hardware][XPU] Register batch-invariant kernels for XPU #41934
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 47 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
c0ffa12
[Hardware][XPU] Added registration of verified batch-invariant kernel…
tzielinski-habana 974211e
Refactoring and minor fixes
tzielinski-habana 498fa8b
Update tests/v1/determinism/test_xpu_batch_invariant.py
tzielinski-habana 5024a1b
Merge branch 'main' into xpu_rl
tzielinski-habana 1f38d3b
Updated docs
tzielinski-habana 34eb0db
Added matmul registration and guarded cublas
tzielinski-habana a3c4a04
Merge branch 'main' into xpu_rl
tzielinski-habana 3ee67e1
Refactoring
tzielinski-habana 323c0b2
Swapped positions of common and matmul overrides
tzielinski-habana 448e30b
Added matmul and integration tests
tzielinski-habana 5cf2167
Only TRITON_ATTN works
tzielinski-habana fc49b26
Minor test improvements
tzielinski-habana 5b5ba56
Further test improvements
tzielinski-habana bb50331
Test fix
tzielinski-habana 7e5dae1
Merge branch 'main' into xpu_rl
tzielinski-habana e3c7a9a
Merge branch 'main' into xpu_rl
tzielinski-habana 75fded1
Tests refactoring
tzielinski-habana 0aafea4
Merge branch 'main' into xpu_rl
xuechendi 4bf9342
Merge pull request #1 from tzielinski-habana/xpu_rl_test_refactoring
tzielinski-habana 4082a73
Addressed review comments
tzielinski-habana 2f3acd3
More tests modifications
tzielinski-habana 5c1bd64
Merge branch 'main' into xpu_rl
tzielinski-habana eef602e
Added oneCCL allreduce setting for batch invariance
tzielinski-habana 9f8cc09
Merge branch 'main' into xpu_rl
tzielinski-habana 3cf1de9
Reduced scope of batch invariance kernel registrations
tzielinski-habana d958731
Added tests
tzielinski-habana 965f17a
xfail some tests
tzielinski-habana 9c8f502
Merge branch 'vllm-project:main' into bi_reduced_scope
tzielinski-habana 8bc664d
Removed unused variable
tzielinski-habana 217bab7
Removed 1 test file and docs mention
tzielinski-habana 75ee644
Merge branch 'vllm-project:main' into xpu_rl
tzielinski-habana e4ffbfd
Merge bi_reduced_scope into xpu_rl (adopting bi_reduced_scope content)
tzielinski-habana 7684491
Merge branch 'main' into xpu_rl
tzielinski-habana d344a3a
Better dispatch key handling
tzielinski-habana 29f9711
Refactored skipping of unsupported XPU backends
tzielinski-habana 39bb6a2
Restrict enable_batch_invariant_mode to XPU and CUDA
tzielinski-habana da41d11
Merge branch 'main' into xpu_rl
tzielinski-habana 3a3d5b6
Merge branch 'main' into xpu_rl
tzielinski-habana 469c601
Merge branch 'main' into xpu_rl
tzielinski-habana f576920
Merge branch 'main' into xpu_rl
tzielinski-habana 36869b7
Merge branch 'main' into xpu_rl
tzielinski-habana 1fa657e
Merge branch 'main' into xpu_rl
tzielinski-habana 16ca2c7
Merge branch 'main' into xpu_rl
tzielinski-habana c123747
Merge branch 'main' into xpu_rl
tzielinski-habana a53f61b
Merge branch 'main' into xpu_rl
tzielinski-habana b032b34
Merge branch 'main' into xpu_rl
tzielinski-habana 194750a
Merge branch 'main' into xpu_rl
tzielinski-habana 9d9c9d9
Merge branch 'main' into xpu_rl
tzielinski-habana 3c52f32
Refactored devices and backends handling in tests
tzielinski-habana e04f0f2
Removed skip_unsupported_backend
tzielinski-habana beccb29
Merge branch 'main' into xpu_rl
tzielinski-habana 458a448
Merge branch 'main' into xpu_rl
tzielinski-habana 94ce14c
Merge branch 'main' into xpu_rl
tzielinski-habana 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
Some comments aren't visible on the classic Files Changed page.
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
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 |
|---|---|---|
|
|
@@ -11,15 +11,24 @@ | |
| from vllm.transformers_utils.model_arch_config_convertor import ( | ||
| ModelArchConfigConvertorBase, | ||
| ) | ||
| from vllm.triton_utils import HAS_TRITON | ||
| from vllm.v1.attention.backends.fa_utils import flash_attn_supports_mla | ||
|
|
||
| skip_unsupported = pytest.mark.skipif( | ||
| skip_if_not_cuda = pytest.mark.skipif( | ||
| not (current_platform.is_cuda() and current_platform.has_device_capability(80)), | ||
| # Supports testing on Ampere and Ada Lovelace devices. | ||
| # Note: For devices with SM < 90, batch invariance does not support CUDA Graphs. | ||
| reason="Requires CUDA and >= Ampere (SM80)", | ||
| ) | ||
|
|
||
| skip_unsupported_device = pytest.mark.skipif( | ||
| not ( | ||
| (current_platform.is_cuda() and current_platform.has_device_capability(80)) | ||
| or (current_platform.is_xpu() and HAS_TRITON) | ||
| ), | ||
| reason="Requires CUDA >= Ampere (SM80) or Intel XPU with Triton", | ||
| ) | ||
|
|
||
| DEFAULT_MODEL = "Qwen/Qwen3-1.7B" | ||
| TEST_MODEL = os.getenv("VLLM_TEST_MODEL", DEFAULT_MODEL) | ||
|
|
||
|
|
@@ -42,6 +51,15 @@ | |
| if flash_attn_supports_mla(): | ||
| BACKENDS.append("FLASH_ATTN_MLA") | ||
|
|
||
| XPU_BACKENDS: list[str] = [ | ||
| "TRITON_ATTN", | ||
| ] | ||
|
|
||
|
|
||
| def skip_unsupported_xpu_backends(backend: str): | ||
| if current_platform.is_xpu() and backend not in XPU_BACKENDS: | ||
| pytest.skip(f"Backend {backend} not verified for batch invariance on XPU") | ||
|
Member
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. Currently all devices and backends are quite complicated, please organize them all together, design with a cleaner version.
Contributor
Author
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. Ok, will do |
||
|
|
||
|
|
||
| def _random_prompt(min_words: int = 1024, max_words: int = 1024 * 2) -> str: | ||
| # Generate more realistic prompts that will actually produce varied tokens | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want it is guaranteed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but that means the PR needs to be much larger. I wanted to register a subset of the kernels first and add the other ones later.