Repository navigation
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
fe220c5 to
1db1aa2
Compare
e4bc894 to
1320c85
Compare
… Needs Review. Signed-off-by: Celina Yang <[email protected]>
…r random helper functions, needs review Signed-off-by: Celina Yang <[email protected]>
…imodel yet, needs follow up Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
- test_model_discovery.py: drop the _ModelDiscovery cases already pinned through OpenAiIngress by test_lora_deployment_base_client.py, the structural checks (hasattr, deepcopy, check_health) and the docs-route cases implied by the exact route-inventory test. - test_builder_ingress.py: hoist the direct-streaming fixture and the second-model helper to module level, compare the router's routes to what the control ingress declares instead of a literal copy, and parametrize the ingress config and KV-aware llm_config cases. - test_multi_model_direct_streaming.py: keep one observation per behavior (discovery to the ingress, chat and streaming to the named model, unresolvable model fails closed); drop the repeats and the single-model class already covered by test_router_direct_streaming.py. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Celina Yang <[email protected]>
1320c85 to
b522338
Compare
## Why The current 256 KiB cap truncates the router copy of large LLM requests, causing body-aware routing to lose information. Several recent routing changes depend on this body: - [#64224](#64224), [#64328](#64328), and [#65095](#65095) use it for KV-aware routing. - [#65680](#65680) uses it for LoRA model selection. - [#66258](#66258) and [#66315](#66315) use it for deployment-aware, multi-model direct streaming. - [#63183](#63183) introduced the body-forwarding gate shared by these paths. This PR raises the default buffer to 8 MiB and lowers the default `maxconn` to 4,096. The sizing and behavior were verified with a real HAProxy 2.8.25 test and against the bundled HAProxy source code. Both settings retain their existing environment-variable overrides. | Consideration | Result | |---|---| | Request size | A one-million-token English request is commonly estimated at roughly 4 MB. The test request is 5.72 MiB, so 8 MiB leaves 2.28 MiB (~40%) headroom. | | Latency | Requests below 256 KiB do not wait longer. Requests from 256 KiB to 8 MiB now wait for the complete body before routing. | | Memory | Buffers are allocated dynamically. A live stream can use roughly 16 MiB across request and response buffers. Lowering `maxconn` from 20,000 to 4,096 reduces the theoretical buffer ceiling from 320 GiB to 64 GiB. | ## Changes - Raise `RAY_SERVE_HAPROXY_INGRESS_REQUEST_ROUTER_BUFSIZE` from 256 KiB to 8 MiB. - Lower `RAY_SERVE_HAPROXY_MAXCONN` from 20,000 to 4,096. - Test a 6,000,014-byte, million-token-sized request end to end. - Derive rendered-config assertions from their constants so environment overrides remain testable. - Update the KV-aware routing guide. ## Tests - Pre-commit hooks, Python compilation, Serve mypy, and Serve pyrefly passed. - HAProxy end-to-end test passed: 1 passed, 37 deselected in 2.85s using bundled HAProxy 2.8.25. This does not duplicate the related PRs: they introduce or consume body-aware routing, while this PR increases the shared buffer default and tests a million-token-sized body. AI assistance was used to implement and validate this change; the submitter reviewed every changed line. --------- Signed-off-by: Seiji Eicher <[email protected]> Signed-off-by: Seiji Eicher <[email protected]>
…t#66360) ## Why The current 256 KiB cap truncates the router copy of large LLM requests, causing body-aware routing to lose information. Several recent routing changes depend on this body: - [ray-project#64224](ray-project#64224), [ray-project#64328](ray-project#64328), and [ray-project#65095](ray-project#65095) use it for KV-aware routing. - [ray-project#65680](ray-project#65680) uses it for LoRA model selection. - [ray-project#66258](ray-project#66258) and [ray-project#66315](ray-project#66315) use it for deployment-aware, multi-model direct streaming. - [ray-project#63183](ray-project#63183) introduced the body-forwarding gate shared by these paths. This PR raises the default buffer to 8 MiB and lowers the default `maxconn` to 4,096. The sizing and behavior were verified with a real HAProxy 2.8.25 test and against the bundled HAProxy source code. Both settings retain their existing environment-variable overrides. | Consideration | Result | |---|---| | Request size | A one-million-token English request is commonly estimated at roughly 4 MB. The test request is 5.72 MiB, so 8 MiB leaves 2.28 MiB (~40%) headroom. | | Latency | Requests below 256 KiB do not wait longer. Requests from 256 KiB to 8 MiB now wait for the complete body before routing. | | Memory | Buffers are allocated dynamically. A live stream can use roughly 16 MiB across request and response buffers. Lowering `maxconn` from 20,000 to 4,096 reduces the theoretical buffer ceiling from 320 GiB to 64 GiB. | ## Changes - Raise `RAY_SERVE_HAPROXY_INGRESS_REQUEST_ROUTER_BUFSIZE` from 256 KiB to 8 MiB. - Lower `RAY_SERVE_HAPROXY_MAXCONN` from 20,000 to 4,096. - Test a 6,000,014-byte, million-token-sized request end to end. - Derive rendered-config assertions from their constants so environment overrides remain testable. - Update the KV-aware routing guide. ## Tests - Pre-commit hooks, Python compilation, Serve mypy, and Serve pyrefly passed. - HAProxy end-to-end test passed: 1 passed, 37 deselected in 2.85s using bundled HAProxy 2.8.25. This does not duplicate the related PRs: they introduce or consume body-aware routing, while this PR increases the shared buffer default and tests a million-token-sized body. AI assistance was used to implement and validate this change; the submitter reviewed every changed line. --------- Signed-off-by: Seiji Eicher <[email protected]> Signed-off-by: Seiji Eicher <[email protected]>
…t#66360) ## Why The current 256 KiB cap truncates the router copy of large LLM requests, causing body-aware routing to lose information. Several recent routing changes depend on this body: - [ray-project#64224](ray-project#64224), [ray-project#64328](ray-project#64328), and [ray-project#65095](ray-project#65095) use it for KV-aware routing. - [ray-project#65680](ray-project#65680) uses it for LoRA model selection. - [ray-project#66258](ray-project#66258) and [ray-project#66315](ray-project#66315) use it for deployment-aware, multi-model direct streaming. - [ray-project#63183](ray-project#63183) introduced the body-forwarding gate shared by these paths. This PR raises the default buffer to 8 MiB and lowers the default `maxconn` to 4,096. The sizing and behavior were verified with a real HAProxy 2.8.25 test and against the bundled HAProxy source code. Both settings retain their existing environment-variable overrides. | Consideration | Result | |---|---| | Request size | A one-million-token English request is commonly estimated at roughly 4 MB. The test request is 5.72 MiB, so 8 MiB leaves 2.28 MiB (~40%) headroom. | | Latency | Requests below 256 KiB do not wait longer. Requests from 256 KiB to 8 MiB now wait for the complete body before routing. | | Memory | Buffers are allocated dynamically. A live stream can use roughly 16 MiB across request and response buffers. Lowering `maxconn` from 20,000 to 4,096 reduces the theoretical buffer ceiling from 320 GiB to 64 GiB. | ## Changes - Raise `RAY_SERVE_HAPROXY_INGRESS_REQUEST_ROUTER_BUFSIZE` from 256 KiB to 8 MiB. - Lower `RAY_SERVE_HAPROXY_MAXCONN` from 20,000 to 4,096. - Test a 6,000,014-byte, million-token-sized request end to end. - Derive rendered-config assertions from their constants so environment overrides remain testable. - Update the KV-aware routing guide. ## Tests - Pre-commit hooks, Python compilation, Serve mypy, and Serve pyrefly passed. - HAProxy end-to-end test passed: 1 passed, 37 deselected in 2.85s using bundled HAProxy 2.8.25. This does not duplicate the related PRs: they introduce or consume body-aware routing, while this PR increases the shared buffer default and tests a million-token-sized body. AI assistance was used to implement and validate this change; the submitter reviewed every changed line. --------- Signed-off-by: Seiji Eicher <[email protected]> Signed-off-by: Seiji Eicher <[email protected]>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
This pull request has been automatically closed because there has been no more activity in the 14 days Please feel free to reopen or open a new pull request if you'd still like this to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for your contribution! |
Why this is needed
The preceding PRs in the stack add deployment-aware direct HTTP routing to Ray Serve. This PR connects those interfaces to the Ray Serve LLM application builder so one application can directly stream from multiple model deployments while retaining a lightweight ingress for control-plane routes such as model discovery.
Summary
Add DirectStreamingIngress, a lightweight application ingress that serves:
Build one _direct_http=True LLMServer deployment per configured model
Pass the model ID → deployment mapping to LLMRouter
Extract the control ingress’s FastAPI route patterns at build time and pass them to LLMRouter
In HAProxy, route all HTTP methods through the ingress request router so ingress-owned routes receive priority
Application topology:
DirectStreamingIngress
├── LLMServer:model-a _direct_http=True
├── LLMServer:model-b _direct_http=True
└── LLMRouter ingress request router
Inference requests stream directly through the selected model replica. Model-discovery requests are routed to DirectStreamingIngress.
Test plan
To Do
Example usage
Set the feature flags before importing Ray Serve LLM, then build a normal multi-model application. The builder creates the lightweight discovery ingress, marks each model deployment
_direct_http=True, and wires the deployment-aware router: