-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Bug fix] Add /model_info endpoint to mini_lb #14535
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
Conversation
PR #13607 changed runtime_endpoint.py to use /model_info instead of /get_model_info, but mini_lb.py was not updated to support the new endpoint. This caused test_disaggregation_basic.py to fail with 404 errors when accessing /model_info through the mini load balancer. This fix: - Adds /model_info endpoint to mini_lb.py - Keeps /get_model_info for backwards compatibility - Updates the backend call to use /model_info (the non-deprecated endpoint)
Summary of ChangesHello @alisonshao, 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 critical regression in the mini load balancer ( 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
|
|
/rerun-stage unit-test-backend-2-gpu |
|
✅ Triggered Check the Actions tab for progress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively resolves the regression by introducing the /model_info endpoint in mini_lb.py and ensuring backward compatibility by retaining /get_model_info. The refactoring of the shared logic into the _get_model_info_impl function is a clean approach that improves code maintainability by avoiding duplication. The changes are well-targeted and correctly address the issue.
| @app.get("/model_info") | ||
| async def model_info(): | ||
| return await _get_model_info_impl() | ||
|
|
||
|
|
||
| @app.get("/get_model_info") | ||
| async def get_model_info(): | ||
| return await _get_model_info_impl() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve maintainability and reduce code duplication, you can register multiple paths to a single handler function in FastAPI. This would make it more explicit that both /model_info and /get_model_info are served by the same logic, and it reduces the number of similar functions to maintain.
| @app.get("/model_info") | |
| async def model_info(): | |
| return await _get_model_info_impl() | |
| @app.get("/get_model_info") | |
| async def get_model_info(): | |
| return await _get_model_info_impl() | |
| @app.get("/model_info") | |
| @app.get("/get_model_info") | |
| async def get_model_info(): | |
| """Handle both /model_info and /get_model_info for backward compatibility.""" | |
| return await _get_model_info_impl() |
b8zhong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think it's the right fix.
Summary
/model_infoendpoint to mini_lb to fix regression introduced by tiny remove deprecated endpoint call #13607/get_model_infofor backwards compatibility/model_info(the non-deprecated endpoint)Root Cause
PR #13607 changed
runtime_endpoint.pyto use/model_infoinstead of/get_model_info, butmini_lb.pywas not updated to support the new endpoint. This causedtest_disaggregation_basic.pyto fail with 404 errors when accessing/model_infothrough the mini load balancer.Error example: https://github.com/sgl-project/sglang/actions/runs/19977384736/job/57312528074
Test plan
test_disaggregation_basic.pypasses in CI after this fix