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

Allow user to specify the tokenizer for compare #224

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

dyastremsky
Copy link
Contributor

@dyastremsky dyastremsky commented Dec 18, 2024

A user mentioned that compare does not work with a non-default tokenizer: #174

This pull request enables passing in a tokenizer for compare to have more accurate token counts.

A couple of clean-up items:

  • Allowing the other tokenizer args (trust_remote_code, tokenizer_revision) to be passed in via profile for the profile parsing
  • Alphabetizing the functions for adding the CLI arg groups to make it easier to navigate the code and help menu

Before the change
Command: genai-perf compare -f artifacts/HuggingFaceH4_zephyr-7b-beta-openai-chat-concurrency1/profile_export.json artifacts/HuggingFaceH4_zephyr-7b-beta-openai-chat-concurrency2/profile_export.json
Graph:
image

After the change (with tokenizer specified):
Command: genai-perf compare --tokenizer HuggingFaceH4/zephyr-7b-beta -f artifacts/HuggingFaceH4_zephyr-7b-beta-openai-chat-concurrency1/profile_export.json artifacts/HuggingFaceH4_zephyr-7b-beta-openai-chat-concurrency2/profile_export.json
Graph:
image

Use tokenizer args
@dyastremsky dyastremsky requested a review from nv-hwoo December 18, 2024 01:16
@dyastremsky dyastremsky self-assigned this Dec 18, 2024
@dyastremsky dyastremsky changed the title Use tokenizer args for compare Enable custom tokenizer usage for compare Dec 18, 2024
@dyastremsky dyastremsky changed the title Enable custom tokenizer usage for compare Allow user to specify the tokenizer for compare Dec 18, 2024
Copy link
Contributor

@debermudez debermudez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dyastremsky dyastremsky merged commit f988e5a into main Dec 18, 2024
6 of 7 checks passed
@dyastremsky dyastremsky deleted the dyas-compare branch December 18, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants