Repository navigation
feat(sglang): upload sidecar metadata with OpenDAL #11470
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
Open
Aphoh
wants to merge
11
commits into
main
Choose a base branch
from
warnold/sglang-metadata-upload-fallback
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
097e211
feat(sglang): upload sidecar metadata with OpenDAL
Aphoh 79e4ad8
refactor(sglang): scope upload dependencies to sidecar
Aphoh 6ba7c4a
docs: defer sidecar metadata upload documentation
Aphoh 2042c3f
fix(sglang): address metadata upload review
Aphoh 09ffe19
refactor(sglang): reduce metadata upload scope
Aphoh e818e97
fix(sglang): bound metadata upload latency
Aphoh 2e5f4c8
feat(sglang): cache and retry metadata uploads
Aphoh fa1ba56
fix(sglang): clarify operator cache setting
Aphoh ffd7f9c
refactor(sglang): harden metadata upload resilience
Aphoh 47ec918
refactor(sglang): simplify metadata delivery
Aphoh 66f1202
refactor(sglang): keep fallback sidecar-only
Aphoh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
P2. The protocol now accepts
fallback_url, but the Python SGLang worker rejects it.MetadataUploadhas#[serde(deny_unknown_fields)]on both sides of this diff. Before this PR, the frontend rejected a request that carriednvext.metadata_upload.fallback_url. I did not rebuild the base tree for that half. The evidence is that the base struct has the attribute and no such field, and that this PR's ownmetadata_upload_parses_urlsruns the identical rejection for an unknownformatkey. That test is green inrust-tests (.)at this SHA. This PR makes the frontend accept the field, andpreprocessor.rs:1750-1757serializes the whole struct intoextra_args.nvext.metadata_upload. But79e4ad8reverted the matching Python change, andcomponents/src/dynamo/common/metadata_upload.py:157-160still allows exactly one key.I ran this against the current file, with the exact payload the frontend forwards:
decode_handler.py:338callsMetadataUploader.from_backend_request(request)fromgenerate(). So on an--enable-rlPython SGLang worker, which is still the mainline SGLang backend, the request now fails inside the worker instead of being rejected at the frontend. The wire schema advertises a field that the default backend cannot honour.Unverified: I did not run the full frontend to worker path. I cannot state which status code the client ends up with. I only know that the worker raises.
Two options work, and either one is fine. Teach
MetadataUploader.from_settingsaboutfallback_url, because it can ignore the value. Or hold the protocol field back until the Python side lands.One more point while you are in this file.
deserialize_metadata_upload_urltrimsurland rejects an empty value.fallback_urlgets neither. Only the sidecar validates it, so every other consumer sees it raw. The earlier revision of this PR trimmed it. The trim was lost in the scope reduction.Uh oh!
There was an error while loading. Please reload this page.
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.
Fixed in e818e97. fallback_url is again trimmed and rejected when empty by the shared Rust protocol. The Python parser now accepts and validates the shared field without changing its existing primary-only upload behavior, so the sidecar-only option no longer breaks the default worker.
Uh oh!
There was an error while loading. Please reload this page.
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.
This still reproduces at
66f1202529. The fix landed, and then the head commit reverted it.e818e97754did fix this.66f1202529("keep fallback sidecar-only") reverted it:I ran this against both trees with the exact payload the frontend forwards:
I also closed the half that I left unverified last round. The frontend really does forward the
field. Here is
OpenAIPreprocessor::backend_extra_argsat this SHA:So on an
--enable-rlPython SGLang worker,decode_handler.py:338callsfrom_backend_request,and that raises on a request the frontend accepted. I reopen the thread on that evidence.
Two notes, which are not new findings:
deserialize_metadata_upload_fallback_urltrims the value and rejects an empty one.
cargo test -p dynamo-llm --no-default-features --lib metadata_uploadgives
metadata_upload_parses_urls ... ok, and the probe above shows" fs:///var/tmp/rollouts "arriving trimmed.
66f1202529also removed the twotest_sglang_decode_handler.pycases that coveredfallback_url. That is why the Python suite is green at this SHA rather than catching this.Whichever way you resolve this, the contract of the parser for
fallback_urlwants a test.Either direction still works. Let
from_settingsacceptfallback_urland ignore it, or holdfallback_urlout ofMetadataUploaduntil the Python side can honour it. The current split doesnot work, because the wire schema advertises a field that the default backend rejects.
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.
Still live at
66f1202529, and still live with today'smainmerged in. I mergedmain(4067d08f7e) into the head myself and measured both sides again.Both sides of the wire on the merged tree, each with a control
Rust, from
cargo test -p dynamo-llm --no-default-features:Python, from
components/src/dynamo/common/metadata_upload.py. That file is the same 5334 bytes with md5e071f0b4f8cbdc64fb5a724346ad2a8bat the merge base, at this head, and atmain. Somaindid not change it, and this PR does not touch it.No test covers this. The string
fallback_urlis in 0 Python files in the repo. I mutated the parser in both directions and ranpytest components/src/dynamo/sglang/tests/test_sglang_decode_handler.py -k metadatain the sglang runtime-test image:fallback_urlurl(control)The control shows that the suite does react to a change in that function, so the middle row is a real gap and not a dead harness. I restored the file and its checksum matched the baseline.
The ask does not change. Either let
from_settingsacceptfallback_urland ignore it, or hold the field out ofMetadataUploaduntil the Python side can honor it.