-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[VLM] Add VLM TP=4 per-commit CI test and improve MMMU eval prompt/parser #21841
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
+101
−3
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,82 @@ | ||||||||||||||||||
| """ | ||||||||||||||||||
| VLM TP=4 per-commit test using Qwen3.5-27B with MMMU evaluation. | ||||||||||||||||||
| """ | ||||||||||||||||||
|
|
||||||||||||||||||
| import unittest | ||||||||||||||||||
| from types import SimpleNamespace | ||||||||||||||||||
|
|
||||||||||||||||||
| from sglang.srt.utils import kill_process_tree | ||||||||||||||||||
| from sglang.test.ci.ci_register import register_cuda_ci | ||||||||||||||||||
| from sglang.test.run_eval import run_eval | ||||||||||||||||||
| from sglang.test.test_utils import ( | ||||||||||||||||||
| DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, | ||||||||||||||||||
| DEFAULT_URL_FOR_TEST, | ||||||||||||||||||
| CustomTestCase, | ||||||||||||||||||
| popen_launch_server, | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| register_cuda_ci(est_time=200, suite="stage-c-test-4-gpu-h100") | ||||||||||||||||||
|
|
||||||||||||||||||
| QWEN35_27B_MODEL = "Qwen/Qwen3.5-27B" | ||||||||||||||||||
| MMMU_ACCURACY_THRESHOLD = 0.65 | ||||||||||||||||||
| MMMU_NUM_EXAMPLES = 32 | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| class TestVLMTP4(CustomTestCase): | ||||||||||||||||||
| @classmethod | ||||||||||||||||||
| def setUpClass(cls): | ||||||||||||||||||
| cls.model = QWEN35_27B_MODEL | ||||||||||||||||||
| cls.base_url = DEFAULT_URL_FOR_TEST | ||||||||||||||||||
| cls.process = popen_launch_server( | ||||||||||||||||||
| cls.model, | ||||||||||||||||||
| cls.base_url, | ||||||||||||||||||
| timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, | ||||||||||||||||||
| other_args=[ | ||||||||||||||||||
| "--tp-size", | ||||||||||||||||||
| "4", | ||||||||||||||||||
| "--cuda-graph-max-bs", | ||||||||||||||||||
| "32", | ||||||||||||||||||
| "--mem-fraction-static", | ||||||||||||||||||
| "0.8", | ||||||||||||||||||
| "--trust-remote-code", | ||||||||||||||||||
| "--mamba-scheduler-strategy", | ||||||||||||||||||
| "extra_buffer", | ||||||||||||||||||
| "--mamba-track-interval", | ||||||||||||||||||
| "128", | ||||||||||||||||||
| "--mamba-ssm-dtype", | ||||||||||||||||||
| "bfloat16", | ||||||||||||||||||
|
Comment on lines
+42
to
+47
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. These arguments (
Suggested change
|
||||||||||||||||||
| "--chunked-prefill-size", | ||||||||||||||||||
| "2048", | ||||||||||||||||||
| "--max-running-requests", | ||||||||||||||||||
| "128", | ||||||||||||||||||
| ], | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| @classmethod | ||||||||||||||||||
| def tearDownClass(cls): | ||||||||||||||||||
| if hasattr(cls, "process") and cls.process: | ||||||||||||||||||
| kill_process_tree(cls.process.pid) | ||||||||||||||||||
|
|
||||||||||||||||||
| def test_mmmu_accuracy(self): | ||||||||||||||||||
| args = SimpleNamespace( | ||||||||||||||||||
| model=self.model, | ||||||||||||||||||
| eval_name="mmmu", | ||||||||||||||||||
| num_examples=MMMU_NUM_EXAMPLES, | ||||||||||||||||||
| num_threads=16, | ||||||||||||||||||
| max_tokens=2048, | ||||||||||||||||||
| chat_template_kwargs={"enable_thinking": False}, | ||||||||||||||||||
| base_url=self.base_url, | ||||||||||||||||||
| host="http://127.0.0.1", | ||||||||||||||||||
| port=int(self.base_url.split(":")[-1]), | ||||||||||||||||||
| ) | ||||||||||||||||||
| metrics = run_eval(args) | ||||||||||||||||||
| print(f"MMMU score: {metrics['score']}") | ||||||||||||||||||
| self.assertGreaterEqual( | ||||||||||||||||||
| metrics["score"], | ||||||||||||||||||
| MMMU_ACCURACY_THRESHOLD, | ||||||||||||||||||
| f"MMMU accuracy {metrics['score']:.4f} below threshold {MMMU_ACCURACY_THRESHOLD}", | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| 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.
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.
The regex is currently case-sensitive for the answer letter (
[A-Z]). While the prompt instructs the model to use a specific format, models may occasionally output lowercase letters (e.g.,Answer: a). Making this check case-insensitive would improve the robustness of the parser.