-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
[CI] Add E2E Blackwell Quantized MoE Test #25723
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
10 commits
Select commit
Hold shift + click to select a range
b82ace9
Add e2e model run for SM100 Quantized MoEs
mgoin f8fa0ce
Add round of tests
mgoin 40fbf30
Cleanup
mgoin e8ae290
Fix trigger
mgoin 75ee6ca
Updates
mgoin 552a451
Merge branch 'main' into blackwell-moe-test
mgoin bdfbf32
Update
mgoin 317f8a5
Increase max wait time for RemoteOpenAIServer
mgoin 526e36a
precommit
mgoin ca15b33
Update server arguments and prompt in tests
mgoin 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
|
||
| import json | ||
| import os | ||
|
|
||
| import pytest | ||
|
|
||
| from tests.utils import RemoteOpenAIServer | ||
| from vllm.platforms import current_platform | ||
|
|
||
| if not current_platform.is_device_capability(100): | ||
| pytest.skip("This test only runs on Blackwell GPUs (SM100).", | ||
| allow_module_level=True) | ||
|
|
||
| os.environ["FLASHINFER_NVCC_THREADS"] = "16" | ||
|
|
||
| # dummy_hf_overrides = {"num_layers": 4, "num_hidden_layers": 4, | ||
| # "text_config": {"num_layers": 4, "num_hidden_layers": 4}} | ||
| dummy_hf_overrides = {"num_layers": 4, "num_hidden_layers": 4} | ||
|
|
||
|
|
||
| def can_initialize(model: str, extra_args: list[str]): | ||
|
|
||
| # Server arguments | ||
| server_args = [ | ||
| "--max-model-len", | ||
| "2048", | ||
| "--max-num-batched-tokens", | ||
| "256", | ||
| "--load-format", | ||
| "dummy", | ||
| "--trust-remote-code", | ||
| "--limit-mm-per-prompt", | ||
| json.dumps({"image": 0}), | ||
| *extra_args, | ||
| ] | ||
|
|
||
| # Launch server and make a simple request | ||
| with RemoteOpenAIServer( | ||
| model, | ||
| server_args, | ||
| max_wait_seconds=1000, # Due to FlashInfer compile | ||
| override_hf_configs=dummy_hf_overrides) as server: | ||
| client = server.get_client() | ||
| # Make a simple request to verify the server works | ||
| completion = client.completions.create( | ||
| model=model, | ||
| prompt=["Hello, World!"], | ||
| temperature=0, | ||
| max_tokens=2, | ||
| ) | ||
| print(completion) | ||
| assert completion.choices[0].text is not None | ||
|
|
||
|
|
||
| ## Llama4 ## | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason=( | ||
| "RuntimeError: run_moe() Expected a value of type " | ||
| "'Optional[List[Tensor]]' for argument '_9' but instead found type " | ||
| "'list'.")) | ||
| def test_llama4_fp8_tensor_moe_flashinfer_cutlass( | ||
| monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_FP8", "1") | ||
| monkeypatch.setenv("VLLM_FLASHINFER_MOE_BACKEND", "throughput") | ||
| can_initialize("nvidia/Llama-4-Scout-17B-16E-Instruct-FP8", []) | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Works, but takes too long to run") | ||
| def test_llama4_fp8_tensor_moe_flashinfer_trtllm( | ||
| monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_FP8", "1") | ||
| monkeypatch.setenv("VLLM_FLASHINFER_MOE_BACKEND", "latency") | ||
| can_initialize("nvidia/Llama-4-Scout-17B-16E-Instruct-FP8", []) | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Works, but takes too long to run") | ||
| def test_llama4_nvfp4_moe_flashinfer_cutlass(monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_FP4", "1") | ||
| monkeypatch.setenv("VLLM_FLASHINFER_MOE_BACKEND", "throughput") | ||
| can_initialize("nvidia/Llama-4-Scout-17B-16E-Instruct-FP4", []) | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="RuntimeError: No kernel found for the given options") | ||
| def test_llama4_nvfp4_moe_flashinfer_trtllm(monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_FP4", "1") | ||
| monkeypatch.setenv("VLLM_FLASHINFER_MOE_BACKEND", "latency") | ||
| can_initialize("nvidia/Llama-4-Scout-17B-16E-Instruct-FP4", []) | ||
|
|
||
|
|
||
| ## DeepSeekV3 ## | ||
|
|
||
|
|
||
| def test_deepseek_fp8_block_moe_deep_gemm(monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_DEEP_GEMM", "1") | ||
| can_initialize("deepseek-ai/DeepSeek-V3.1", []) | ||
|
|
||
|
|
||
| def test_deepseek_nvfp4_moe_flashinfer_cutlass( | ||
| monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_FP4", "1") | ||
| monkeypatch.setenv("VLLM_FLASHINFER_MOE_BACKEND", "throughput") | ||
| can_initialize("nvidia/DeepSeek-R1-0528-FP4-v2", []) | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="RuntimeError: No kernel found for the given options") | ||
| def test_deepseek_nvfp4_moe_flashinfer_trtllm(monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_FP4", "1") | ||
| monkeypatch.setenv("VLLM_FLASHINFER_MOE_BACKEND", "latency") | ||
| can_initialize("nvidia/DeepSeek-R1-0528-FP4-v2", []) | ||
yewentao256 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| ## GPT-OSS ## | ||
|
|
||
|
|
||
| def test_gptoss_mxfp4bf16_moe_flashinfer(monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_MXFP4_BF16", "1") | ||
| can_initialize("openai/gpt-oss-20b", []) | ||
|
|
||
|
|
||
| def test_gptoss_mxfp4mxfp8_moe_flashinfer_cutlass( | ||
| monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_MXFP4_MXFP8_CUTLASS", "1") | ||
| can_initialize("openai/gpt-oss-20b", []) | ||
|
|
||
|
|
||
| def test_gptoss_mxfp4mxfp8_moe_flashinfer_trtllm( | ||
| monkeypatch: pytest.MonkeyPatch): | ||
| monkeypatch.setenv("VLLM_USE_FLASHINFER_MOE_MXFP4_MXFP8", "1") | ||
| can_initialize("openai/gpt-oss-20b", []) | ||
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
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.