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)
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.patchprofile_utils.patchprofiler_manager.patchHunk-level result (
patch -p1 --dry-run --fuzz=2):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 containseagleas skippable — therefore abort the entire set. Runtime patching is skipped altogether, the profile round runs withshape_discovery=falseanddetailed_annotations=false, the resulting trace carries nokernel_shape_profilerevents, and roofline analysis runs degraded.Root cause
All six failing hunks use
detailed_annotationsas a context (unchanged) line, i.e. they assume the field already exists inProfileReq. That field was introduced upstream onmainby:The v0.5.18 release branch was cut before that commit and never cherry-picked it. Verified presence of
detailed_annotationsinpython/sglang/srt/managers/io_struct.py:v0.5.17v0.5.18(71de97b264)fc0b95e7ba^(parent)fc0b95e7bamainfrom 2026-08-18 onwardSo
sglang_0_5_18/in practice targets post-2026-08-18main, 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 strictgit apply --check.The same patch content ships in TraceLens
14eb554(2026-08-26),a59a9c1(2026-08-28) andmain7dcf39f(2026-09-02) —sglang_0_5_18/io_struct.patchis 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_annotationsas an inserted line inio_struct.patch(and align the context of the other two patches with the tag's text), so thatsglang_0_5_18/matches the version its directory name declares.Environment
0.5.18(tag71de97b264b04dcd514cf904003028aefe9775c8, 2026-08-20), editable install at/sgl-workspace/sglanga59a9c165bb64c7c416fd7cf79149803d552e43c(also reproduced with14eb554)_server_patcher.py