chore(http-client): tune tcp settings, update defaults/utils#168
chore(http-client): tune tcp settings, update defaults/utils#168
Conversation
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
Summary of ChangesHello, 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 enhances the HTTP client's resilience and testing infrastructure. It introduces a sophisticated 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. Changelog
Activity
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 introduces a new variable-throughput-server for more realistic testing, tunes TCP settings, and refactors the benchmark client. The changes are generally positive, but I've identified a few critical issues in the new server related to potential division-by-zero errors from unvalidated user inputs. Additionally, there's an inconsistency in the TCP keepalive setting comments and a minor code duplication in the benchmark client that could be improved.
There was a problem hiding this comment.
Pull request overview
This PR updates the HTTP client benchmarking and transport defaults to improve stability under high concurrency, and adds a new OpenAI-compatible test server that simulates more realistic (long-tailed) response sizes and streaming behavior.
Changes:
- Update the benchmark HTTP client receiver loop to drain completed results via
poll()before blocking onrecv(). - Add
variable_throughput_server.py, a multi-process OpenAI-compatible stub server with variable output lengths and optional streaming jitter. - Tune TCP socket defaults (keepalive probes + smaller socket buffers) and harden test-server signal handling in
max_throughput_server.py.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/inference_endpoint/utils/benchmark_httpclient.py |
Adjust receiver logic to drain queued results via poll() before awaiting recv(). |
src/inference_endpoint/testing/variable_throughput_server.py |
New realistic variable-length / streaming-jitter test server with multi-worker SO_REUSEPORT support. |
src/inference_endpoint/testing/max_throughput_server.py |
Ensure SIGINT/SIGTERM handler doesn’t run full shutdown logic in worker processes. |
src/inference_endpoint/endpoint_client/http.py |
Update keepalive probe settings and reduce socket buffer sizes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
0f0fae0 to
0bb540a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Review Council — Multi-AI Code Review CouncilReviewed by: Codex + Claude | Depth: thorough Found 6 new issues across 3 files (after deduplicating against 28 existing review comments). 🔴 Must Fix (high)
🟡 Should Fix (medium)
🔵 Consider (low)
Note: Several issues found by both reviewers were already covered by the 28 existing review comments on this PR (recv() blocking forever, DEFAULT_LOADGEN_CORES=5 on small machines, max_concurrency splitting, TCP_KEEPCNT timing, _lognormal_params validation). These were deduplicated and not re-posted. 🤖 Generated with Claude Code |
- worker: restore fatal exit when warmup establishes 0 connections - worker: warn when max_connections < num_workers (over-allocation) - config: resolve min_required_connections=-1 regardless of max_connections - cpu_affinity: update DEFAULT_LOADGEN_CORES comment to explain why 5 - benchmark_httpclient: extract _process_result helper, add receiver_done event so sender stops when receiver decides to stop - variable_throughput_server: validate output_len_mean > 0, warn on max_concurrency < num_workers, prevent task GC via _tasks set Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move os.environ.setdefault below imports to fix E402 ruff errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this PR do?
changes:
variable-throughput-serverto imitate real world long-tailed LLM servers at various throughputs (0-10_000)Variable-Throughput-Server:
Example:
Deepseek-r1 interactive streaming threshold:
endpoints run:
NOTE:
Type of change
Related issues
Testing
Checklist