[Feature] Add support for audio modality and MMSU benchmark support - #1608
Open
TianhaoLiang2000 wants to merge 4 commits into
Open
[Feature] Add support for audio modality and MMSU benchmark support#1608TianhaoLiang2000 wants to merge 4 commits into
TianhaoLiang2000 wants to merge 4 commits into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a first-class
AUDIOmodality path to VLMEvalKit and lands MMSU as the first supported audio benchmark.The implementation keeps audio separate from existing image and video flows. It introduces an audio dataset base class, audio-aware dataset registration, audio routing in both local and API inference paths, OpenAI-compatible audio payload formatting for LMDeploy/vLLM API models, and MMSU dataset loading, prompt construction, and exact-matching evaluation.
The target end-to-end path validated in this PR is:
Motivation
VLMEvalKit already has mature modality-specific paths for image and video benchmarks. Audio benchmarks should not be represented as image-like or video-like datasets with special-case media fields. This PR adds audio as a peer modality so future audio benchmarks can reuse a clear and extensible contract.
The first supported benchmark is MMSU, a 5,000-sample spoken language understanding and reasoning benchmark with audio plus multiple-choice questions.
What Changed
1. Added
AudioBaseDatasetNew file:
AudioBaseDatasetdefines the shared audio dataset contract:[ {"type": "audio", "value": "/abs/or/relative/path/to/audio.wav"}, {"type": "text", "value": "Question... Options..."}, ]It handles:
MODALITY = 'AUDIO'.audio_path.audiotoLMUData/audios/<dataset>/.audio_pathto the dataset audio root.model.generate(message=..., dataset=...)contract used by other modalities.2. Registered AUDIO datasets
Changed file:
This PR adds:
and includes
AUDIO_DATASETinDATASET_CLASSES, so:MMSUis included inSUPPORTED_DATASETS.DATASET_MODALITY('MMSU')returnsAUDIO.DATASET_TYPE('MMSU')returnsMCQ.3. Added audio inference routing
Changed files:
The local route imports
infer_data_job_audioand dispatches datasets withMODALITY == 'AUDIO'to the audio route.The async API pipeline now includes:
DatasetType = Literal["image", "video", "audio", "mt"].dataset_type="audio"task production._produce_audio_tasks()for building audio prompts without video-specific subprocess/frame logic.model.generate()path.audiodata when present, so prediction TSVs do not duplicate large media payloads.inference_audio.pyreuses the established inference pattern while preserving audio-specific final result cleanup.4. Added OpenAI-compatible audio payload support
Changed file:
LMDeployWrappernow acceptsaudioinallowed_typesand maps internal audio prompt items to OpenAI-compatibleaudio_urlchat content.When
--local-mediais sent, the audio file is encoded into a data URL:{ "type": "audio_url", "audio_url": { "url": "data:audio/wav;base64,..." } }When
--local-mediais not sent, the local audio path is converted to a file URI:{ "type": "audio_url", "audio_url": { "url": "file:///abs/path/audio.wav" } }The wrapper also passes through existing media URLs unchanged:
http://...https://...file://...data:...5. Added MMSU dataset support
New file:
The new
MMSUDatasetis implemented as:Evaluation uses
mcq_vanilla_evalwith exact matching by default and reports:category.sub-category.sub-sub-category.task_name.linguistics_sub_discipline.Supported Audio Formats
The first implementation supports these audio file extensions and MIME mappings:
.wavaudio/wav.mp3audio/mpeg.m4aaudio/mp4.flacaudio/flac.oggaudio/ogg.aacaudio/aac.ogaaudio/ogg.opusaaudio/oggSupported input representations:
audio_pathas an absolute path.audio_pathas a path relative toLMUData/audios/<dataset>/.audioas embedded base64 content in a TSV.audioas bytes or Hugging Face audio payloads during MMSU conversion.http://,https://,file://, ordata:media URLs.Supported API payload modes:
local_media=False.local_media=True.The local file URI mode requires the remote vLLM/Lmdeploy server to be able to read the referenced media path, for example through a shared filesystem and an appropriate allowed local media path configuration. The base64 mode avoids that filesystem coupling at the cost of larger request payloads.
CLI and API Behavior
run.py --base-urlbuildsLMDeployAPIdynamically, so this PR does not require adding a hard-coded Qwen3-Omni model entry tovlmeval/config.py.Relevant API-mode arguments used in validation:
Validation
Single-sample endpoint validation
One MMSU sample was tested against a vLLM-served
Qwen3-Omni-30B-A3B-InstructOpenAI-compatible endpoint.with
--local-mediasent:{"type": "audio_url", "audio_url": {"url": "file:///mnt/.../sample.wav"}}without
--local-mediasent:{"type": "audio_url", "audio_url": {"url": "data:audio/wav;base64,..."}}Both modes returned normal model content through the same
LMDeployAPIwrapper.Full MMSU end-to-end validation
Validation environment:
MMSUQwen3-Omni-30B-A3B-Instructexact_matchingAPI_NPROC: 64temperature: 0.6top_p: 0.95top_k: 20max_tokens: 16384Total-score comparison
file://local mediaThe two runs used sampling parameters with
temperature=0.6, so the small metric delta should be treated as sampling variation rather than evidence that one transport encoding is systematically better. The important validation result is that bothfile://and base64 audio payload modes complete the full 5,000-sample MMSU run with zero inference and judge failures.