-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[Test] Add flashmla attention backend test #5587
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
34 commits
Select commit
Hold shift + click to select a range
4e2b3f4
fix flashmla bug
sleepcoo 718e565
Merge branch 'main' into fix_mla_head
sleepcoo 42a5015
Merge branch 'main' into fix_mla_head
zhyncs 69df8a4
Merge branch 'main' into fix_mla_head
sleepcoo dc5841f
Merge branch 'main' into fix_mla_head
sleepcoo 9ccb3a4
Merge branch 'main' into fix_mla_head
Fridge003 e12fe56
Description of your changes
PopSoda2002 411f3a8
Add test
PopSoda2002 08f8940
Add FlashMLA backend unit tests
PopSoda2002 2c64672
Add FlashMLA backend unit tests
PopSoda2002 01d2a3d
Merge remote-tracking branch 'sleepcoo/fix_mla_head' into feature/test
PopSoda2002 97b8cb1
Merge
PopSoda2002 2b31408
using dpsk v2 lite model
PopSoda2002 f2fee49
Description of your changes
PopSoda2002 fe9f706
Add test
PopSoda2002 37d97d8
Add FlashMLA backend unit tests
PopSoda2002 59a90a6
Add FlashMLA backend unit tests
PopSoda2002 afb3ff8
using dpsk v2 lite model
PopSoda2002 aaa5856
using dpsk v2 lite model
PopSoda2002 dd54edd
Update flash mla attention backend test
PopSoda2002 5cafa02
Add test in CI
PopSoda2002 fe62c71
Delete gsm8k
PopSoda2002 05fb284
resolve conflicts
PopSoda2002 9a39286
Add CI
PopSoda2002 27bb705
Fix linting
PopSoda2002 d1c7bb0
fix
PopSoda2002 e548b6b
Merge branch 'main' into feature/test
Fridge003 cce7948
Merge branch 'main' into feature/test
Fridge003 11c3d2e
Add FlashMLA dependency to CMakeLists.txt
PopSoda2002 4b94d7b
Add FlashMLA to CI installation script
PopSoda2002 7e470ea
Remove kernel flashmla
PopSoda2002 089e1b6
Remove kernel flashmla
PopSoda2002 6542be8
Merge branch 'main' into feature/test
PopSoda2002 dbdece2
Merge branch 'main' into feature/test
PopSoda2002 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
""" | ||
Usage: | ||
python3 -m unittest test_flash_mla_attention_backend.TestFlashMLAAttnBackend.test_mmlu | ||
""" | ||
|
||
import unittest | ||
from types import SimpleNamespace | ||
|
||
from sglang.srt.utils import kill_process_tree | ||
from sglang.test.run_eval import run_eval | ||
from sglang.test.test_utils import ( | ||
DEFAULT_MLA_MODEL_NAME_FOR_TEST, | ||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, | ||
DEFAULT_URL_FOR_TEST, | ||
is_in_ci, | ||
popen_launch_server, | ||
run_bench_one_batch, | ||
) | ||
|
||
|
||
class TestFlashMLAAttnBackend(unittest.TestCase): | ||
def test_latency(self): | ||
output_throughput = run_bench_one_batch( | ||
DEFAULT_MLA_MODEL_NAME_FOR_TEST, | ||
[ | ||
"--attention-backend", | ||
"flashmla", | ||
"--enable-torch-compile", | ||
"--cuda-graph-max-bs", | ||
"16", | ||
"--trust-remote-code", | ||
], | ||
) | ||
|
||
if is_in_ci(): | ||
self.assertGreater(output_throughput, 153) | ||
|
||
def test_mmlu(self): | ||
model = DEFAULT_MLA_MODEL_NAME_FOR_TEST | ||
base_url = DEFAULT_URL_FOR_TEST | ||
process = popen_launch_server( | ||
model, | ||
base_url, | ||
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, | ||
other_args=["--attention-backend", "flashmla", "--trust-remote-code"], | ||
) | ||
|
||
try: | ||
args = SimpleNamespace( | ||
base_url=base_url, | ||
model=model, | ||
eval_name="mmlu", | ||
num_examples=64, | ||
num_threads=32, | ||
) | ||
|
||
metrics = run_eval(args) | ||
self.assertGreaterEqual(metrics["score"], 0.2) | ||
finally: | ||
kill_process_tree(process.pid) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
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.