Repository navigation
Replace hasattr with isinstance in SHM feature helpers - #29549
Merged
merrymercy merged 1 commit intoJun 29, 2026
Merged
Conversation
Use explicit isinstance checks against BaseBatchReq, TokenizedGenerateReqInput, and TokenizedEmbeddingReqInput instead of hasattr probes in wrap_shm_features, unwrap_shm_features, and has_shm_features. Access MultimodalDataItem fields (feature, precomputed_embeddings, hash) directly since they are declared dataclass fields.
merrymercy
requested review from
Ying1123,
hnyls2002 and
xiezhq-hermann
as code owners
June 28, 2026 05:22
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
merrymercy
force-pushed
the
refactor/mm-utils-replace-hasattr-with-isinstance
branch
from
June 28, 2026 09:35
1fdb433 to
8e9e781
Compare
merrymercy
commented
Jun 28, 2026
merrymercy
left a comment
Collaborator
Author
There was a problem hiding this comment.
approved, ready for merge
vstone-w
pushed a commit
to ClownBin/sglang
that referenced
this pull request
Jul 2, 2026
Chronostasys
pushed a commit
to MindLab-Research/sglang
that referenced
this pull request
Aug 24, 2026
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.
Summary
hasattrprobes with explicitisinstancechecks againstBaseBatchReq,TokenizedGenerateReqInput, andTokenizedEmbeddingReqInputinwrap_shm_features,unwrap_shm_features, andhas_shm_features.MultimodalDataItemfields (feature,precomputed_embeddings,hash) directly since they are declared dataclass fields, removing unnecessaryhasattr/getattrguards.Test plan
CI States
Latest PR Test (Base): ✅ Run #28318059857
Latest PR Test (Extra): 🚫 Run #28318266897