Repository navigation
[Refactor] multimodal: Replace padding strategies with helpers - #44845
Merged
Merged
Conversation
mickqian
requested review from
Ying1123,
adarshxs,
hnyls2002,
kpham-sgl,
merrymercy,
pyc96 and
xiezhq-hermann
as code owners
October 17, 2026 03:39
Collaborator
Author
|
/rerun-test test/registered/unit/managers/test_mm_utils_split.py |
Contributor
|
🚀 |
Collaborator
Author
|
/tag-and-rerun-ci |
This was referenced Oct 17, 2026
This was referenced Oct 25, 2026
adarshxs
added a commit
to adarshxs/sglang
that referenced
this pull request
Oct 26, 2026
Resolve conflicts and port the transformers backend to current main: - pyproject: keep main's transformers==5.19.0 and uvicorn>=0.51 pins (drop this branch's 5.15.0 bump). - model_config: keep main's EmbeddingGemma2 context clamp and apply the transformers embedding-plan clamp on top of it. - lora_manager.set_lora_module: keep main's **kwargs passthrough together with the transformers LoRA adapter wrap. - Delete the old models/transformers.py and port main's two changes to it: the embedding_rowwise TP-style alias (sgl-project#39012) into layers.py, and the pad_mm_tokens helper (sgl-project#44845) into MultiModalMixin.pad_input_ids. Export _normalize_tp_style from the package for test_hf_transformers. - trtllm_mha_backend: drop this branch's causal= kwarg; main added the identical line, and the auto-merge produced a repeated keyword. - Parallel linear layers take parallel_group instead of tp_rank/tp_size (sgl-project#42588): the fused QKV projection partitions on "attn_tp" and unfused K/V shards use ReplicatedParallelGroup("attn_tp", tp_size // kv_heads). TP unit tests build group stubs via sglang.test.parallel_groups. - test_transformers_graph: drop the TCPCG fullgraph compile test, since the backend is retired and its custom attention op removed (sgl-project#42287, sgl-project#42288); give the hand-built PrefillCudaGraphRunner the attributes main's replay path now reads. - test_embedding_model_spec: the support matrix has 10 rows (ModernBert and Roberta from this branch plus main's EmbeddingGemma2). - test_transformers_fallback: follow main's removal of the skip-substrs test (sgl-project#43503). Co-Authored-By: Claude Fable 5.1 <[email protected]>
3 tasks done
This was referenced Oct 28, 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.
Motivation
Multimodal token padding doesn't need a strategy object. Keep the model's
pad_input_idsinterface, but call the shared helpers directly.Modifications
pad_mm_tokensandpad_mm_token_pairs, and migrate the model callers.data_offsetsand legacy configuration in the existing CPU tests.Mechanical move — reproducible
The algorithm extraction is isolated in
36db17e4623. Reproduction scripts.From a checkout containing this branch:
CI States
Latest PR Test (Base): ✅ Run #38999650666
Latest PR Test (Extra): ❌ Run #38999650608
Latest PR Test (AMD ROCm 10): ❌ Run #38999650630