#15: Track first chunks and fix TPOT calculation#23
Conversation
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
Summary of ChangesHello @nv-alicheng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a bug in the TPOT calculation for streaming responses by refining how output tokens are counted. It modifies the internal representation of streaming outputs from a concatenated string to a structured list of chunks, allowing the system to differentiate and exclude the initial response chunk from TPOT averaging. This ensures more accurate performance metrics for language models, particularly in streaming scenarios. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly refactors the TPOT calculation by changing how response chunks are stored and processed. Instead of a single joined string, the output now preserves chunk separation, allowing for a more accurate exclusion of the first chunk's tokens from the metric. The addition of a progress bar in the benchmark command is a great usability improvement.
My review includes a critical fix to remove a sys.exit() call that could cause abrupt process termination, and a couple of suggestions to improve code clarity and maintainability. Overall, the changes are well-implemented and the tests have been updated accordingly.
nvzhihanj
left a comment
There was a problem hiding this comment.
LGTM, @arekay-nv to review as well
arekay-nv
left a comment
There was a problem hiding this comment.
Thanks @nv-alicheng !
Fix #15
What does this PR do?
Changes the output JSONL file to contain the list of chunks rather than an accumulated. This is used so that the TPOT calculation can accurately calculate the number of tokens in the first chunk so they can be excluded from the 'number of tokens' to be averaged over.
Type of change
Related issues
Testing
Checklist