Skip to content

upstream-sync 4/5: bulk upstream merge (~1,290 non-conflicting commits)#15

Merged
KHAEntertainment merged 1389 commits intomainfrom
upstream-sync/pr4-bulk-upstream
Mar 31, 2026
Merged

upstream-sync 4/5: bulk upstream merge (~1,290 non-conflicting commits)#15
KHAEntertainment merged 1389 commits intomainfrom
upstream-sync/pr4-bulk-upstream

Conversation

@KHAEntertainment
Copy link
Copy Markdown
Collaborator

Summary

  • Phase 06B — Bulk Upstream Merge: git merge upstream/main to sweep in ~1,290 remaining non-conflicting upstream commits. All architecturally sensitive files (SessionController, cache, scheduler, snapshot) were already reconciled in PRs 1-3.

Review note

@coderabbitai ignore

This PR contains ~1,290 upstream commits from sgl-project/sglang that are unmodified from upstream. All fork-specific architectural changes were handled in PRs 1–3. Manual review of this PR should focus on conflict resolution markers only — the upstream code itself does not need line-by-line review.

Conflict resolution rules applied

  • Fork-modified files: kept fork version (already reconciled)
  • Upstream-only files: accepted upstream version
  • No snapshot/ files were overwritten

Validation

  • Phase 0 (environment) ✅
  • Phase 1 (stateless inference) ✅
  • Phase 2 (MambaPool 5/5) ✅
  • Phase 4 (live server) ✅
  • Phase 7 (snapshot E2E 6/6) ✅

Part of

Upstream SGLang sync series — PR 4 of 5. Depends on PR 3 (scheduler + HTTP). This is the volume PR — the meaningful changes are in PRs 1-3 and 5.

🤖 Generated with Claude Code

yuumn and others added 30 commits March 23, 2026 10:27
Co-authored-by: yuumn <1010797597@qqã.com>
…tall (sgl-project#21182)

Co-authored-by: Alison Shao <alison.shao@mac.lan>
…t#21181)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ject#21186)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rnel (sgl-project#21019)

Co-authored-by: luoyuan.luo <luoyuan.luo@antgroup.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DarkSharpness and others added 6 commits March 31, 2026 08:56
Co-authored-by: Alison Shao <alison.shao@Mac.attlocal.net>
…t#21728)

Co-authored-by: 百麒 <yaozhong.lyz@alibaba-inc.com>
…g main

Merged upstream/main into upstream-sync-2026-Q1. Conflict resolution strategy:
- Phase-reconciled files: preserved our mamba/snapshot work, integrated upstream additions
- Non-mamba files: accepted upstream versions wholesale
- Snapshot package intact (enable-snapshot-persistence, save_snapshot endpoints)

Key integrations from upstream:
- Linear attention backend (server_args, hybrid_linear_attn_backend)
- CVE-2026-3060 network security fix (localhost default in network.py)
- HiSparse coordinator support (schedule_batch, scheduler)
- Priority scheduling (QueueCount, enable_priority_preemption)
- Streaming backlog coalescing (tokenizer_manager)
- DNS resolution (NetworkAddress.resolve_host/resolved)
- JIT kernel test discovery (run_suite.py)
- NUMA bind utils and tensor_bridge imports (scheduler)
- KV transfer metrics for disaggregation (req_time_stats)

Preserved our work:
- snapshot/ package (mamba_snapshot, tier_manager, conversation_tracker, etc.)
- Snapshot REST handlers (SaveSnapshot, ListSnapshots, RestoreSnapshot, etc.)
- session_params, BatchMultimodalDecodeReq/Output in io_struct
- get_numa_node stub, configure_ipv6, from_parts in utils
- Socket fd-based uvicorn startup (http_server)
- SGLANG_ENABLE_SPEC_V2 + mamba extra_buffer validation (memory_pool)
- process_batch_result_dllm (scheduler_output_processor_mixin)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…k-upstream

# Conflicts:
#	.gitignore
#	benchmark/hicache/bench_multiturn.py
#	python/sglang/srt/managers/scheduler_output_processor_mixin.py
@KHAEntertainment KHAEntertainment merged commit 3b6049e into main Mar 31, 2026
176 of 192 checks passed
@KHAEntertainment KHAEntertainment deleted the upstream-sync/pr4-bulk-upstream branch April 1, 2026 04:00
KHAEntertainment pushed a commit that referenced this pull request Apr 1, 2026
Restores the continuation_ids + _stateful_generate path in
handle_restore_snapshot that was lost when Phase 8 was reconstructed
from a lost A100 session during the upstream merge (PR #15/#16).

The working implementation (A100 backup commit 857dd02) had two parts:
1. scheduler.py: detect continuation_ids, append to origin_input_ids,
   set new_req._stateful_generate=True, return None (deferred)
2. scheduler_output_processor_mixin.py: on req.finished(), send
   RestoreSnapshotReqOutput(output_ids=...) via send_to_tokenizer

Part 2 was ported correctly. Part 1 was missing, so _stateful_generate
was never set, the mixin's output routing was dead code, and the
snapshot_restore_result_queue in tokenizer_manager never unblocked.

Changes to scheduler.py handle_restore_snapshot (create_new_request path):
- Detect stateful_generate = bool(recv_req.continuation_ids)
- Append continuation_ids to origin_input_ids when present
- Guard against context overflow before pool allocation
- Apply recv_req.max_new_tokens to SamplingParams
- Pass http_worker_ipc through to new Req
- Set new_req._stateful_generate = stateful_generate
- Return None when stateful_generate=True (deferred output)

io_struct.py and scheduler_output_processor_mixin.py are unchanged —
both were already correct.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.