Repository navigation
Convert IPC dataclasses to msgspec.Struct with opt-in msgpack transport - #28688
Merged
Merged
Conversation
rainj-me
requested review from
ByronHsu,
CatherineSue,
HaiShaw,
JustinTong0323,
ShangmingCai,
Ying1123,
fzyzcjy,
hnyls2002,
ispobock,
liusy58,
merrymercy,
mickqian,
slin1237,
sufeng-buaa,
xiezhq-hermann,
yhyang201 and
yuan-luo
as code owners
June 18, 2026 23:31
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
5 tasks done
merrymercy
approved these changes
Jun 19, 2026
Contributor
|
note for myself:
|
Contributor
|
/tag-and-rerun-ci |
merrymercy
requested review from
AgainstEntropy,
ping1jing2 and
yichiche
as code owners
June 19, 2026 21:49
merrymercy
force-pushed
the
dev/msgpack-migration
branch
from
June 25, 2026 23:33
8a89608 to
e7f9926
Compare
Contributor
|
good ci status CI StatesLatest PR Test (Base): ❌ Run #28207193093 |
merrymercy
force-pushed
the
dev/msgpack-migration
branch
from
June 26, 2026 13:26
e7f9926 to
2cf97b4
Compare
merrymercy
reviewed
Jun 26, 2026
merrymercy
force-pushed
the
dev/msgpack-migration
branch
from
June 26, 2026 13:51
2cf97b4 to
c423efc
Compare
merrymercy
force-pushed
the
dev/msgpack-migration
branch
from
June 26, 2026 14:09
b041945 to
ab9be65
Compare
merrymercy
force-pushed
the
dev/msgpack-migration
branch
from
June 26, 2026 15:05
6dcbcef to
0902d2c
Compare
Contributor
|
/tag-and-rerun-ci |
2 tasks done
Closed
6 tasks
This was referenced Jun 27, 2026
2 tasks done
3 of 4 tasks
sunxxuns
added a commit
that referenced
this pull request
Jun 29, 2026
…ructions PR #28688 (commit be19301) converted TokenizedGenerateReqInput from a @DataClass to a kw_only=True msgspec.Struct, making token_type_ids (declared Optional[List[int]] without a default) a required keyword argument. The test was never updated, so both TokenizedGenerateReqInput constructions raise TypeError: Missing required argument 'token_type_ids'. This completes the fix started in PR #29584 which added input_embeds=None but missed token_type_ids. The BatchTokenizedGenerateReqInput nested construction is also fixed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Prepare SGLang IPC payloads for typed msgpack serialization without changing the default runtime transport yet.
This PR converts the IPC request/output classes from dataclasses to
msgspec.Struct, but keeps pickle IPC enabled by default for compatibility. Developers can opt into the msgspec/msgpack transport by setting:For auditing fallback behavior, set:
Changes
io_struct.pyfrom dataclasses tomsgspec.Struct.SGLANG_USE_PICKLE_IPC.SGLANG_USE_PICKLE_IPC=True.array,torch.Tensor,numpy.ndarray, and numpy floating scalars.PickleWrappersupport for fields and structs that still carry opaque Python objects or broadAny/Dict[str, Any]payloads.time_stats,customized_info, multimodal inputs, and mooncake multimodal data at process boundaries.customized_infothrough the normal scheduler -> detokenizer -> tokenizer-manager path.msgspec.Structfields instead of dataclass fields.Notes
PickleWrapperis an intentional workaround during the migration. It lets the new typed structs travel through msgpack while fields that are not yet msgpack-safe continue to round-trip through pickle explicitly. This keeps the migration incremental and makes remaining pickle usage easier to audit.The default behavior is still pickle IPC. The msgpack/msgspec path is opt-in with
SGLANG_USE_PICKLE_IPC=0until the remaining opaque fields are narrowed or wrapped safely.Test Plan
CI States
Latest PR Test (Base): ✅ Run #28248758478
Latest PR Test (Extra): 🚫 Run #28248758407