Conversation
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
Summary of ChangesHello @arekay-nv, 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 refactors the event logging mechanism within the inference endpoint, moving from a CSV-based output to a more resilient JSON format. This change prevents data corruption caused by special characters in event payloads and provides a more structured and flexible way to store and process event logs, ultimately improving the reliability of benchmark data collection. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 successfully replaces the CSV event output with a more robust JSONL format. The changes are well-contained and correctly update the parameter names and function calls across the affected files. I have one suggestion to ensure the generated JSONL file strictly adheres to the format's specification.
There was a problem hiding this comment.
Pull request overview
This PR changes the event output format from CSV to JSON (JSONL) to properly handle response text containing commas that would break CSV delimiters.
Key Changes:
- Renamed the
dump_to_csvmethod todump_to_jsonand updated it to output JSONL format (one JSON object per line) - Renamed the
dump_events_csvparameter todump_events_logthroughout the codebase - Enabled event logging by default in the benchmark command
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/inference_endpoint/metrics/reporter.py | Refactored CSV dumping to JSON output using orjson with formatted and sorted keys |
| src/inference_endpoint/load_generator/session.py | Updated parameter names from dump_events_csv to dump_events_log and changed file extension to .json |
| src/inference_endpoint/commands/benchmark.py | Enabled event logging by setting dump_events_log=True |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| + "\n" | ||
| ) |
There was a problem hiding this comment.
String concatenation with + "\n" creates unnecessary intermediate string objects. Consider using f.write() twice (once for the JSON and once for the newline) or using an f-string for better performance in tight loops.
| + "\n" | |
| ) | |
| ) | |
| f.write("\n") |
What does this PR do?
The CSV output for events contains the response text which may include commas and hence break the delimiters. A json output format seems more appropriate to represent the data.
This PR changes the CSV output for events to JSON.
Type of change
Related issues
Testing
Checklist