-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add V2-lite model test #7390
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
Add V2-lite model test #7390
Changes from all commits
35c3474
ca1cea3
2cd51a2
5ca627b
b180dfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| """ | ||
| Usage: | ||
| python3 -m unittest test_intel_amx_attention_backend.TestIntelAMXAttnBackend.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, | ||
| CustomTestCase, | ||
| is_in_ci, | ||
| popen_launch_server, | ||
| run_bench_one_batch, | ||
| ) | ||
|
|
||
|
|
||
| class TestIntelAMXAttnBackend(CustomTestCase): | ||
|
Contributor
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. The test class class TestIntelAMXAttnBackend(CustomTestCase):
"""Tests for the Intel AMX attention backend, covering latency and MMLU accuracy."""Style Guide ReferencesFootnotes
|
||
| def test_latency(self): | ||
|
Contributor
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. The test method def test_latency(self):
"""Measures and verifies the latency/throughput of the Intel AMX attention backend."""Style Guide ReferencesFootnotes
|
||
| prefill_latency, decode_throughput, decode_latency = run_bench_one_batch( | ||
| DEFAULT_MLA_MODEL_NAME_FOR_TEST, | ||
| [ | ||
| "--attention-backend", | ||
| "intel_amx", | ||
| "--mem-fraction-static", | ||
| "0.05", | ||
| "--disable-radix", | ||
| "--trust-remote-code", | ||
| "--batch-size", | ||
| "4", | ||
| ], | ||
| ) | ||
|
|
||
| print(f"{prefill_latency=}") | ||
| print(f"{decode_throughput=}") | ||
| print(f"{decode_latency=}") | ||
|
|
||
| if is_in_ci(): | ||
| self.assertGreater(decode_throughput, 10) | ||
|
|
||
| def test_mmlu(self): | ||
|
Contributor
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. The test method def test_mmlu(self):
"""Tests MMLU evaluation accuracy using the Intel AMX attention backend."""Style Guide ReferencesFootnotes
|
||
| 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", | ||
| "intel_amx", | ||
| "--mem-fraction-static", | ||
| "0.05", | ||
| "--disable-radix", | ||
| "--trust-remote-code", | ||
| "--disable-overlap-schedule", | ||
| ], | ||
| ) | ||
|
|
||
| try: | ||
| args = SimpleNamespace( | ||
| base_url=base_url, | ||
| model=model, | ||
| eval_name="mmlu", | ||
| num_examples=64, | ||
| num_threads=32, | ||
|
Comment on lines
+68
to
+69
Contributor
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. The values num_examples=MMLU_TEST_NUM_EXAMPLES, # Define MMLU_TEST_NUM_EXAMPLES = 64
num_threads=MMLU_TEST_NUM_THREADS, # Define MMLU_TEST_NUM_THREADS = 32Style Guide ReferencesFootnotes
|
||
| ) | ||
|
|
||
| metrics = run_eval(args) | ||
| self.assertGreater(metrics["score"], 0.5) | ||
| finally: | ||
| kill_process_tree(process.pid) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Here will break other tests
https://github.com/sgl-project/sglang/actions/runs/16053195382/job/45306321847?pr=7390#step:5:135
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.
@yanbing-j is this fixed now?
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.
I suppose this will be fixed by b180dfa.