feat(benchmarks): support HF model names in multi-turn benchmark #27850
+0
−2
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.
Summary
This PR enables
benchmark_serving_multi_turn.pyto accept HuggingFace model names directly (e.g.,meta-llama/Llama-2-7b-hf), in addition to local file paths.Problem
Previously, the script would fail when given a HuggingFace model name:
python benchmark_serving_multi_turn.py --model meta-llama/Llama-2-7b-hf ... # Error: OSError: Path does not exist: meta-llama/Llama-2-7b-hfSolution
Remove the path validation check and let
AutoTokenizer.from_pretrained()handle both local paths and HuggingFace model names. This is safe because AutoTokenizer already provides clear, informative error messages for invalid inputs.Changes
AutoTokenizer Error Messages
Testing shows that AutoTokenizer provides excellent error messages for all invalid inputs:
Non-existent absolute path:
Non-existent relative path:
Non-existent simple name:
Invalid HuggingFace model name:
These error messages clearly distinguish between local paths and HuggingFace model names, making additional validation unnecessary.
Testing
This change can be tested with: