Skip to content

sglang_0_5_18 patch set does not apply to the sglang v0.5.18 release #1001

Description

@BaoYunkai

Problem

3 of the 10 patches in examples/custom_workflows/inference_analysis/sglang_roofline_patches/sglang_0_5_18/ fail to apply against an official sglang v0.5.18 release build:

  • io_struct.patch
  • profile_utils.patch
  • profiler_manager.patch

Hunk-level result (patch -p1 --dry-run --fuzz=2):

io_struct.patch          Hunk #1 FAILED                    (1/1 failed)
profile_utils.patch      Hunk #2 FAILED                    (1/5 failed)
profiler_manager.patch   Hunks #3, #4, #8, #9 FAILED       (4/9 failed)

Every other hunk applies. Consumers that apply this set as a transaction — e.g. Hyperloom's _server_patcher.py, which is all-or-nothing and only treats patches whose filename contains eagle as skippable — therefore abort the entire set. Runtime patching is skipped altogether, the profile round runs with shape_discovery=false and detailed_annotations=false, the resulting trace carries no kernel_shape_profiler events, and roofline analysis runs degraded.

Root cause

All six failing hunks use detailed_annotations as a context (unchanged) line, i.e. they assume the field already exists in ProfileReq. That field was introduced upstream on main by:

commit fc0b95e7badd94198925722445b93f063905a71c
date   2026-08-18T08:09:07Z
title  Profiling Enhancements [2/3]: detailed execution step annotations (#24911)

The v0.5.18 release branch was cut before that commit and never cherry-picked it. Verified presence of detailed_annotations in python/sglang/srt/managers/io_struct.py:

ref date present
tag v0.5.17 2026-08-07 no
tag v0.5.18 (71de97b264) 2026-08-20 no
fc0b95e7ba^ (parent) 2026-08-18 no
fc0b95e7ba 2026-08-18 yes
main from 2026-08-18 onward yes

So sglang_0_5_18/ in practice targets post-2026-08-18 main, not the v0.5.18 release. Because the patch directory is selected by the runtime version string (0.5.18), a genuine v0.5.18 release build is matched to a patch set it cannot accept.

Confirmation that this single missing field is the entire cause: in a scratch git repo containing only the three target files taken from v0.5.18, applying upstream fc0b95e7ba's changes to those files (which applies cleanly to the release sources) makes all three TraceLens patches pass strict git apply --check.

The same patch content ships in TraceLens 14eb554 (2026-08-26), a59a9c1 (2026-08-28) and main 7dcf39f (2026-09-02) — sglang_0_5_18/io_struct.patch is byte-identical across all three, so upgrading TraceLens does not help.

Suggested fix

Rewrite this patch set against the v0.5.18 tag sources: add detailed_annotations as an inserted line in io_struct.patch (and align the context of the other two patches with the tag's text), so that sglang_0_5_18/ matches the version its directory name declares.

Environment

  • sglang: 0.5.18 (tag 71de97b264b04dcd514cf904003028aefe9775c8, 2026-08-20), editable install at /sgl-workspace/sglang
  • TraceLens: a59a9c165bb64c7c416fd7cf79149803d552e43c (also reproduced with 14eb554)
  • Applier: Hyperloom _server_patcher.py
  • ROCm 7.2.0, torch 2.9.1+rocm7.2.0, Python 3.10.12, 8x MI355X (gfx950)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions