Skip to content

Upstream sync 2026-05-25 (158 commits) - #101

Draft
Clarit-AI wants to merge 160 commits into
mainfrom
upstream-sync-20260525
Draft

Upstream sync 2026-05-25 (158 commits)#101
Clarit-AI wants to merge 160 commits into
mainfrom
upstream-sync-20260525

Conversation

@Clarit-AI

@Clarit-AI Clarit-AI commented May 26, 2026

Copy link
Copy Markdown
Owner

Upstream sync — 2026-05-25

Merges sgl-project/sglang upstream/main @ 2b1e53c98 into the Engram fork.

  • Base: origin/main @ 9d85d453b
  • Upstream: upstream/main @ 2b1e53c98
  • Commits merged: 158

⚠️ DRAFT — not ready. Awaiting GPU validation (scripts/validate-sync.sh on the H100) and a version tag before this is marked ready. Do not merge yet.

📌 Deviation from brief: the brief was authored against origin/main @ 46a9f41e1 / upstream/main @ 2aa699530 (121 commits, 2 conflict files). Both refs advanced before execution — origin/main via merged hygiene PRs #99/#100, upstream/main via normal movement — yielding 158 commits and 4 conflict files. Proceeded with reviewer approval; both conflict guards stayed armed.

Conflict resolution (4 files)

File Resolution
python/sglang/srt/managers/schedule_batch.py Keep ENGRAM conversation_id block and adopt upstream array("q", origin_input_ids) storage.
python/sglang/srt/managers/tokenizer_manager.py Keep ENGRAM_MODIFIED header and add upstream from __future__ import annotations.
python/sglang/srt/managers/scheduler.py Forward-port — see note below.
sgl-kernel/python/sgl_kernel/flash_mla.py Keep ENGRAM_MODIFIED header and add upstream import dataclasses.

scheduler.py forward-port note

Upstream refactored the inline construction of output_streamer / batch_result_processor out of __init__ into two new helper methods, init_output_streamer() and init_batch_result_processor(). This collided with two ENGRAM kwarg injections. Resolution: adopt upstream's extracted-method structure, and relocate the two ENGRAM kwargs into the new method bodies:

  • send_to_tokenizer=self.ipc_channels.send_to_tokenizer (M3 stateful-generate output routing) → now at scheduler.py:1755
  • snapshot_hook_manager=self.snapshot_hook_manager (M2 hook) → now at scheduler.py:1782

Runtime-ordering verified safe statically: the relocated reads execute when init_output_streamer()/init_batch_result_processor() are called (in __init__), and both dependencies are assigned earlier — init_ipc_channels() at L421 and init_snapshot_system() at L507, both before the L630/632 call site. ⚠️ Validate at Phase 3b test #1 (server startup) and #5 — an AttributeError here would only surface at runtime, not in py_compile.

Marker accounting (for reviewers / CodeRabbit / Codex — do not re-flag)

  • Broad BEGIN ENGRAM / END ENGRAM = 336 / 338. The −2 is entirely pre-existing example markers in .engram/SYNC_PLAYBOOK.md (2 BEGIN / 4 END) — documentation prose describing the marker convention, not code markers. Identical on origin/main; untouched by this merge. Independently flagged as benign in the 2026-05-25 sync report.
  • Code markers balanced: python/ = 73 / 73; every individually merged file balances.
  • Headers unchanged: 99 broad / 30 narrow.
  • Preflight: the dangling KHA-390 marker in schedule_batch.py was converted to the inline ENGRAM_CHANGED form in a separate commit before the merge (KHA-390 is closed).

Phase 3b validation checklist (post-GPU, before ready)

ℹ️ The ~9 hardware CI checks always fail on the fork (no GPU runners) and are not merge blockers.

Local quality gates (CPU-only, this checkout)

  • ✅ Conflict markers: 0 remaining
  • py_compile: all 4 modules pass (syntax-only; no CUDA/torch init)
  • ✅ Code-marker conservation: python/ 73/73, headers unchanged
  • ⏸️ Lint / types / tests: deferred to Phase 3b (GPU)

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ❌ Run #26477063450
Latest PR Test (Extra): ❌ Run #26477086339

ch-wan and others added 30 commits May 21, 2026 10:25
)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lanced too (sgl-project#25923)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rwardContext (sgl-project#25983)

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…e lazy property with init-time capture (sgl-project#26012)

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…check stalls (sgl-project#24751)

Signed-off-by: abinggo <107740309+abinggo@users.noreply.github.com>
Co-authored-by: Yang <ID+Y-aang@users.noreply.github.com>
…for slow tokenizers (sgl-project#25953)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… FP8 (sgl-project#26057)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zijiexia and others added 14 commits May 26, 2026 20:06
…ore all-reduce (sgl-project#26394)

Signed-off-by: Shangming Cai <csmthu@gmail.com>
…partition is not 16-aligned (sgl-project#22627)

Co-authored-by: vguduruTT <venkatesh.guduru@mulitcorewareinc.com>
…ckend (sgl-project#26413)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: sglang-bot <sglang-bot@users.noreply.github.com>
Convert the dangling '# --- BEGIN ENGRAM KHA-390 ---' single-line marker at
schedule_batch.py:1294 to the inline ENGRAM_CHANGED form. KHA-390 is closed in
Linear; this is settled hygiene. Balances the file (3/2 -> 2/2) and the repo-wide
python/ tree (74/73 -> 73/73) so the post-merge BEGIN==END check passes naturally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sync engram fork with sgl-project/sglang upstream/main @ 2b1e53c.
origin/main base @ 9d85d45 (advanced from the brief's 46a9f41 via merged
hygiene PRs #99/#100; upstream advanced 2aa6995 -> 2b1e53c).

Conflicts resolved (4 files; brief anticipated 2 — upstream's ~37 extra
commits added scheduler.py and flash_mla.py):
- schedule_batch.py: keep ENGRAM conversation_id block + adopt upstream
  array("q", origin_input_ids) storage (brief §8).
- tokenizer_manager.py: keep ENGRAM_MODIFIED header + upstream
  `from __future__ import annotations` (brief §7).
- scheduler.py: adopt upstream's init_output_streamer()/
  init_batch_result_processor() refactor; relocate the two ENGRAM kwarg
  blocks (send_to_tokenizer = M3 output routing, snapshot_hook_manager = M2
  hook) into the new helper methods. Dependency ordering verified safe
  (init_ipc_channels L421, init_snapshot_system L507 precede the calls).
- flash_mla.py: keep ENGRAM_MODIFIED header + upstream `import dataclasses`.

Preflight: converted the dangling KHA-390 marker in schedule_batch.py to the
inline ENGRAM_CHANGED form (separate commit) before the merge.

Marker balance: python/ 30/73/73 (balanced); broad 336/338 residual is
pre-existing .engram/SYNC_PLAYBOOK.md documentation prose (identical on
origin/main), not a merge defect.

Awaiting GPU validation (validate-sync.sh) and version tag before ready.

Co-Authored-By: Claude Opus 4.7 (1M context) <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.