-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Benchmark] Add single turn MTBench to Serving Bench #17202
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
Changes from 3 commits
aa6b750
b527e39
fe706ae
07bfe66
b4c3793
8a43105
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 |
---|---|---|
|
@@ -771,6 +771,58 @@ | |
return sampled_requests | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
# MT-Bench Dataset Implementation | ||
# ----------------------------------------------------------------------------- | ||
|
||
|
||
class MTBenchDataset(HuggingFaceDataset): | ||
""" | ||
MT-Bench Dataset. | ||
https://huggingface.co/datasets/philschmid/mt-bench | ||
|
||
We create a single turn dataset for MT-Bench. | ||
This is similar to Spec decoding benchmark setup in vLLM | ||
https://github.com/vllm-project/vllm/blob/9d98ab5ec/examples/offline_inference/eagle.py#L14-L18 # noqa: E501 | ||
""" | ||
|
||
DEFAULT_OUTPUT_LEN = 256 # avg len used in SD bench in vLLM | ||
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. QQ: Which SD bench do you mean? 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. I was refering to the offline eagle bench. Lmk if you would like me to clarify this in the comment 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. oh I think it's quite random then. What about using longer outputs like 1K+? 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. 1K would make the MTBench run 4x longer. My experience so far has been that 256 is good enough to know the inference metrics and doesnt change much with longer output len with MTBench. |
||
SUPPORTED_DATASET_PATHS = { | ||
"philschmid/mt-bench", | ||
} | ||
|
||
def sample(self, | ||
tokenizer: PreTrainedTokenizerBase, | ||
num_requests: int, | ||
output_len: Optional[int] = None, | ||
enable_multimodal_chat: bool = False, | ||
**kwargs) -> list: | ||
output_len = (output_len | ||
if output_len is not None else self.DEFAULT_OUTPUT_LEN) | ||
sampled_requests = [] | ||
|
||
for item in self.data: | ||
if len(sampled_requests) >= num_requests: | ||
break | ||
prompt = item['turns'][0] | ||
|
||
# apply template | ||
prompt=tokenizer.apply_chat_template([{ | ||
"role": "user", | ||
"content": prompt | ||
}], add_generation_prompt=True, tokenize=False) | ||
|
||
prompt_len = len(tokenizer(prompt).input_ids) | ||
sampled_requests.append( | ||
SampleRequest( | ||
prompt=prompt, | ||
prompt_len=prompt_len, | ||
expected_output_len=output_len, | ||
)) | ||
self.maybe_oversample_requests(sampled_requests, num_requests) | ||
return sampled_requests | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
# AIMO Dataset Implementation | ||
# ----------------------------------------------------------------------------- | ||
|
Uh oh!
There was an error while loading. Please reload this page.