Repository navigation
[Refactor] TCPCG: Consolidate attention eager regions and isolate Inkling policy (4/9) - #42288
Merged
Oasis-Git merged 13 commits intoOct 17, 2026
Merged
Conversation
Oasis-Git
requested review from
1am9trash,
BBuf,
Edwardf0t1,
Fridge003,
HaiShaw,
JustinTong0323,
Qiaolin-Yu,
YAMY1234,
Ying1123,
ch-wan,
fzyzcjy,
hebiao064,
hnyls2002,
hubertlu-tw,
ispobock,
kkHuang-amd,
merrymercy,
ping1jing2,
rainj-me,
sogalin,
wisclmy0611 and
zijiexia
as code owners
October 2, 2026 23:24
This was referenced Oct 2, 2026
Oasis-Git
force-pushed
the
refactor/tcpcg-04-attention-eager
branch
from
October 11, 2026 04:22
c5cabe3 to
fed12ee
Compare
2 tasks done
Collaborator
Author
Collaborator
Author
|
/rerun-failed-ci |
This comment has been minimized.
This comment has been minimized.
Collaborator
Author
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 <noreply@anthropic.com>
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.
This is step 4/9, split from the original TCPCG removal PR #41634.
Steps 1–3 are merged. Rebased onto upstream
main(58cb1a2be6); the PR contains only step 4. Review the step-4 files.Replace attention's TCPCG split-op adapters and layer-registry lookups with class-owned eager methods. On BCG replay, these methods read the live prepared batch through
get_forward_batch()from step 2's runner-owned scope. The eager decorator and replay callbacks do not capture or rebind a batch argument.Series
Changes
RadixAttention._eager_attention. Preserve main’s sparse-BCG fix: sparse attention also runs in an eager region and reads the live batch during replay.attention/graph_utils.py. Preserve the newer eager padded-extend handling, including independent query/KV extents and tuple outputs.ForwardContextunchanged. Publish the full-prefill flag and raw token count in a separate runner-ownedprefill_graph_scope, with restoration on exit.The legacy TCPCG context and layer registries remain temporarily for unmigrated callers until step 8. This changes attention dispatch and eager replay, while preserving backend computation and graph-owned output buffers.
Review fix: prefill scope
Require the runner-owned prefill scope before entering the migrated eager methods. Decode BCG also handles TARGET_VERIFY and DLLM_EXTEND, which count as extend but do not publish a prefill batch. These modes retain their original backend path. Apply the scope boundary to Radix, linear, HPC, MLA fusion eligibility, and Inkling eager/fusion gates. Add CPU regressions for decode BCG without a batch scope.
Review fixes: compiler compatibility and BCG test coverage
Validation
python file.py -f): 30 passed under the same shim.CI States
Latest PR Test (Base): ✅ Run #39007966841
Latest PR Test (Extra): ❌ Run #39007966810
Latest PR Test (AMD ROCm 10): ❌ Run #39007966845