Skip to content
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

Use ignore_eos when benchmarking Triton + vLLM deterministically #204

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion genai-perf/genai_perf/inputs/converters/vllm_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def _add_request_params(self, payload: Dict, config: InputsConfig) -> None:
lower=1, # output token must be >= 1
)
)
sampling_parameters = {
sampling_parameters: Dict[Any, Any] = {
"max_tokens": f"{number_of_tokens}",
}
if config.output_tokens_deterministic:
sampling_parameters["min_tokens"] = f"{number_of_tokens}"
sampling_parameters["ignore_eos"] = True
sampling_parameters_str = json.dumps(sampling_parameters)
payload["sampling_parameters"] = [sampling_parameters_str]
for key, value in config.extra_inputs.items():
Expand Down
4 changes: 2 additions & 2 deletions genai-perf/tests/test_triton_vllm_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ def test_convert_with_sampling_parameters(self):
"text_input": ["text input one"],
"exclude_input_in_output": [True],
"sampling_parameters": [
'{"max_tokens": "1234", "min_tokens": "1234"}'
'{"max_tokens": "1234", "min_tokens": "1234", "ignore_eos": true}'
],
},
{
"model": "test_model",
"text_input": ["text input two"],
"exclude_input_in_output": [True],
"sampling_parameters": [
'{"max_tokens": "1234", "min_tokens": "1234"}'
'{"max_tokens": "1234", "min_tokens": "1234", "ignore_eos": true}'
],
},
]
Expand Down
Loading