servediff 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. servediff-0.1.0/CHANGELOG.md +15 -0
  2. servediff-0.1.0/CONTRIBUTING.md +22 -0
  3. servediff-0.1.0/LICENSE +202 -0
  4. servediff-0.1.0/MANIFEST.in +3 -0
  5. servediff-0.1.0/PKG-INFO +168 -0
  6. servediff-0.1.0/README.md +147 -0
  7. servediff-0.1.0/README.zh-CN.md +46 -0
  8. servediff-0.1.0/examples/issue-excerpts/vllm-47047-v0.23-default.log +1 -0
  9. servediff-0.1.0/examples/issue-excerpts/vllm-47047-v0.23-marlin.log +2 -0
  10. servediff-0.1.0/examples/issue-excerpts/vllm-53472-v0.23.log +2 -0
  11. servediff-0.1.0/examples/issue-excerpts/vllm-53472-v0.26-flag.log +2 -0
  12. servediff-0.1.0/examples/issue-excerpts/vllm-53472-v0.26.log +2 -0
  13. servediff-0.1.0/pyproject.toml +37 -0
  14. servediff-0.1.0/setup.cfg +4 -0
  15. servediff-0.1.0/src/servediff/__init__.py +6 -0
  16. servediff-0.1.0/src/servediff/__main__.py +5 -0
  17. servediff-0.1.0/src/servediff/cli.py +302 -0
  18. servediff-0.1.0/src/servediff/env.py +111 -0
  19. servediff-0.1.0/src/servediff.egg-info/PKG-INFO +168 -0
  20. servediff-0.1.0/src/servediff.egg-info/SOURCES.txt +30 -0
  21. servediff-0.1.0/src/servediff.egg-info/dependency_links.txt +1 -0
  22. servediff-0.1.0/src/servediff.egg-info/entry_points.txt +2 -0
  23. servediff-0.1.0/src/servediff.egg-info/requires.txt +3 -0
  24. servediff-0.1.0/src/servediff.egg-info/top_level.txt +1 -0
  25. servediff-0.1.0/tests/fixtures/README.md +13 -0
  26. servediff-0.1.0/tests/fixtures/vllm-47047-v0.23-default.log +1 -0
  27. servediff-0.1.0/tests/fixtures/vllm-47047-v0.23-marlin.log +2 -0
  28. servediff-0.1.0/tests/fixtures/vllm-53472-v0.23.log +2 -0
  29. servediff-0.1.0/tests/fixtures/vllm-53472-v0.26-flag.log +2 -0
  30. servediff-0.1.0/tests/fixtures/vllm-53472-v0.26.log +2 -0
  31. servediff-0.1.0/tests/test_cli.py +162 -0
  32. servediff-0.1.0/tests/test_env.py +60 -0
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 — 2026-10-29
4
+
5
+ First version.
6
+
7
+ - `servediff show <log>`: effective configuration facts from a vLLM or SGLang startup log,
8
+ each with the line it came from.
9
+ - `servediff diff <a.log> <b.log>`: version, arguments, attention / MoE backend, CUDA graph
10
+ mode and captures, model runner, UVA fallback, startup outcome and root-cause error.
11
+ Warns when one side failed to start. Errors after the server is ready are hidden unless
12
+ `--all`.
13
+ - `servediff env [--python PATH]`: snapshot package versions, GPU and engine env vars of a
14
+ server environment, with secret-looking values redacted. `servediff diff` on two
15
+ snapshots lists inference-relevant changes first.
@@ -0,0 +1,22 @@
1
+ # Contributing
2
+
3
+ The most useful contribution is a **log line servediff missed**.
4
+
5
+ 1. Run `servediff show your-server.log` and find the setting that is `<absent>` but is
6
+ printed in the log.
7
+ 2. Open an issue with the engine version and the exact log line(s). Remove paths,
8
+ hostnames and anything private first.
9
+ 3. For a pull request: add the lines as a fixture under `tests/fixtures/` (say where they
10
+ came from in `tests/fixtures/README.md`), add a test, then the rule in
11
+ `src/servediff/cli.py`.
12
+
13
+ ```bash
14
+ pip install -e ".[dev]"
15
+ pytest -q
16
+ ```
17
+
18
+ Rules for new facts:
19
+
20
+ - A fact comes from a line the server printed. No defaults, no guessing.
21
+ - If the same setting is printed in several formats across versions, one rule should
22
+ cover them, with a fixture for each format.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ include CHANGELOG.md CONTRIBUTING.md README.zh-CN.md
2
+ recursive-include tests/fixtures *.log *.md
3
+ recursive-include examples *.log
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: servediff
3
+ Version: 0.1.0
4
+ Summary: Diff what your vLLM / SGLang server actually ran with: auto-selected backends, CUDA graphs, startup failures, dependency versions.
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/apex-mochen/servediff
7
+ Project-URL: Issues, https://github.com/apex-mochen/servediff/issues
8
+ Project-URL: Changelog, https://github.com/apex-mochen/servediff/blob/main/CHANGELOG.md
9
+ Keywords: vllm,sglang,llm-inference,performance-regression,debugging
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Debuggers
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Provides-Extra: dev
19
+ Requires-Dist: pytest>=8; extra == "dev"
20
+ Dynamic: license-file
21
+
22
+ # servediff
23
+
24
+ **Same flags, different server.** `servediff` shows what your vLLM or SGLang server
25
+ *actually* ran with — and what changed between two runs.
26
+
27
+ Benchmark result files only record the client side. After an upgrade, the server can
28
+ silently pick a different MoE or attention backend, change its CUDA graph capture,
29
+ fall back to another code path, or run against different torch / triton / flashinfer
30
+ builds. Today you find that by reading startup logs and bisecting by hand.
31
+ `servediff` does the reading for you.
32
+
33
+ - **Who it is for:** anyone comparing two vLLM / SGLang runs — after an upgrade, a flag
34
+ change, or between machines — who needs to know *what differs on the server side*.
35
+ - **What it reads:** the server's startup log, and optionally a snapshot of the
36
+ server's Python environment. Offline, no GPU, no dependencies.
37
+ - **What it does not do:** it does not say *which* difference caused a performance
38
+ change. That still needs an A/B run. It tells you what to A/B.
39
+
40
+ ## Try it in one minute (no GPU)
41
+
42
+ ```bash
43
+ git clone https://github.com/apex-mochen/servediff && cd servediff
44
+ pip install .
45
+ servediff diff examples/issue-excerpts/vllm-47047-v0.23-default.log examples/issue-excerpts/vllm-47047-v0.23-marlin.log
46
+ ```
47
+
48
+ ```text
49
+ fact baseline candidate status
50
+ backend.moe VLLM_CUTLASS (NvFp4) MARLIN (NvFp4) changed
51
+
52
+ 1 difference(s); 0 fact(s) identical. Absent means the log did not print it, not that it was off.
53
+ ```
54
+
55
+ That is the difference the reporter of
56
+ [vllm#47047](https://github.com/vllm-project/vllm/issues/47047) found by hand after a
57
+ v0.21 → v0.23 throughput drop. The example files are the log lines posted in that
58
+ issue (see [tests/fixtures/README.md](https://github.com/apex-mochen/servediff/blob/main/tests/fixtures/README.md)).
59
+
60
+ ## Real example: same flags, vLLM 0.28.0 vs 0.30.0
61
+
62
+ Two startup logs from one RTX 4060 Laptop under WSL2, identical flags
63
+ (Qwen2.5-0.5B-Instruct, fp16, `--max-model-len 2048`, `--gpu-memory-utilization 0.45`):
64
+
65
+ ```bash
66
+ servediff diff vllm-0.28.0.log vllm-0.30.0.log
67
+ ```
68
+
69
+ ```text
70
+ warning: baseline server failed to start: RuntimeError: UVA is not available; facts after the failure are absent because startup stopped, not because they were off
71
+
72
+ fact baseline candidate status
73
+ backend.attention <absent> FLASH_ATTN only_candidate
74
+ backend.flash_attn_version <absent> 2 only_candidate
75
+ backend.sampling_flashinfer <absent> disabled only_candidate
76
+ cuda_graph.captures <absent> ["PIECEWISE x51", "FULL x2", "FULL x35"] only_candidate
77
+ cuda_graph.pool_gib <absent> 0.17 only_candidate
78
+ engine.version 0.28.0 0.30.0 changed
79
+ startup failed ready changed
80
+ startup.error ["RuntimeError: UVA is not available", " <absent> only_baseline
81
+ uva_buffers <absent> fallback: device memory only_candidate
82
+
83
+ 9 difference(s); 8 fact(s) identical. Absent means the log did not print it, not that it was off.
84
+ ```
85
+
86
+ 0.28.0 does not start on WSL2 with default settings; 0.30.0 does, because it falls
87
+ back to device memory when pinned memory is unavailable. Upstream fixed this in
88
+ [vllm#56908](https://github.com/vllm-project/vllm/pull/56908), first released in
89
+ v0.30.0. Forcing the V1 model runner on 0.28.0 (`VLLM_USE_V2_MODEL_RUNNER=0`) makes it
90
+ start, and the remaining server-side differences are:
91
+
92
+ ```text
93
+ fact baseline candidate status
94
+ cuda_graph.captures ["mixed prefill-decode, PIECEWISE x51", ["PIECEWISE x51", "FULL x2", "FULL x35"] changed
95
+ cuda_graph.pool_gib 0.36 0.17 changed
96
+ engine.version 0.28.0 0.30.0 changed
97
+ model_runner <absent> V2 only_candidate
98
+ uva_buffers <absent> fallback: device memory only_candidate
99
+
100
+ 5 difference(s); 11 fact(s) identical. Absent means the log did not print it, not that it was off.
101
+ ```
102
+
103
+ ## Dependency versions: `servediff env`
104
+
105
+ Logs do not print torch / triton / flashinfer versions, and upgrades of those change
106
+ server behaviour too. Snapshot each server environment with its own interpreter —
107
+ nothing needs to be installed into it:
108
+
109
+ ```bash
110
+ servediff env --python /path/to/old-venv/bin/python -o old.json
111
+ servediff env --python /path/to/new-venv/bin/python -o new.json
112
+ servediff diff old.json new.json
113
+ ```
114
+
115
+ Excerpt from the same two environments (20 inference-relevant rows; 74 other packages
116
+ hidden unless you pass `--all`):
117
+
118
+ ```text
119
+ pkg.flashinfer-python 0.6.16.post3 0.6.18.post1 changed
120
+ pkg.nvidia-cuda-nvcc 13.3.73 13.0.88 changed
121
+ pkg.nvidia-cutlass-dsl 4.6.2 4.7.1 changed
122
+ pkg.torch 2.13.0 2.13.0+cu130 changed
123
+ pkg.transformers 5.16.1 5.17.0 changed
124
+ pkg.vllm 0.28.0 0.30.0 changed
125
+ ```
126
+
127
+ Note the older vLLM environment carries *newer* CUDA toolkit wheels (13.3 vs 13.0).
128
+ Whether that matters for performance is not known — that is what an A/B run is for.
129
+ Versions are read from package metadata, so the same torch build can show as `2.13.0`
130
+ in one environment and `2.13.0+cu130` in another.
131
+
132
+ The snapshot records Python, GPU name and driver (via `nvidia-smi`), all installed
133
+ package versions, and env vars starting with `VLLM_`, `SGLANG_`, `SGL_`, `CUDA_`,
134
+ `NCCL_`, `TORCH_`, `PYTORCH_`, `FLASHINFER_`, `TRITON_`. Values of variables whose name
135
+ contains `TOKEN`, `KEY`, `SECRET`, `PASSWORD`, `CREDENTIAL` or `AUTH` are replaced with
136
+ `<redacted>`. Snapshots and logs contain local paths: review them before sharing.
137
+
138
+ ## What it extracts
139
+
140
+ | Fact | vLLM | SGLang |
141
+ |---|---|---|
142
+ | version | banner / engine init | — (not printed) |
143
+ | arguments | `non-default args` | `server_args` (all args) |
144
+ | attention backend | `Using X attention backend` | `attention_backend` arg |
145
+ | MoE backend | three log formats seen in 0.23–0.30 | `moe_runner_backend` arg |
146
+ | CUDA graph | eager mode, `cudagraph_mode`, capture sets, pool size | prefill CUDA graph disabled |
147
+ | model runner, UVA fallback | `Using V2 Model Runner`, pinned-memory fallback | — |
148
+ | startup outcome | ready / failed + root-cause error | ready |
149
+
150
+ Every fact keeps the log line it came from (`servediff show <log>` or `--json`).
151
+ A fact the log did not print is `<absent>`: servediff never fills in defaults.
152
+ Options shared by both engines (dtype, context length, memory fraction, prefix cache,
153
+ CUDA graph, TP size) are mapped to common names, so a vLLM log and an SGLang log can be
154
+ compared, though the result is noisier than a same-engine diff.
155
+
156
+ Exit codes: `0` no differences, `1` differences, `2` nothing recognised.
157
+
158
+ ## Limits
159
+
160
+ - Tested on: log excerpts posted in vllm#47047 (v0.23) and vllm#53472 (v0.23, v0.26);
161
+ full startup logs of vLLM 0.28.0 and 0.30.0 and one SGLang log, all single-GPU with a
162
+ dense model. TP > 1, MoE models in full logs, and other versions are not yet verified.
163
+ - Parsing is regex-based on log text, which changes between versions. A missed line
164
+ shows up as `<absent>`, never as a wrong value — please report it.
165
+
166
+ ## License
167
+
168
+ Apache-2.0.
@@ -0,0 +1,147 @@
1
+ # servediff
2
+
3
+ **Same flags, different server.** `servediff` shows what your vLLM or SGLang server
4
+ *actually* ran with — and what changed between two runs.
5
+
6
+ Benchmark result files only record the client side. After an upgrade, the server can
7
+ silently pick a different MoE or attention backend, change its CUDA graph capture,
8
+ fall back to another code path, or run against different torch / triton / flashinfer
9
+ builds. Today you find that by reading startup logs and bisecting by hand.
10
+ `servediff` does the reading for you.
11
+
12
+ - **Who it is for:** anyone comparing two vLLM / SGLang runs — after an upgrade, a flag
13
+ change, or between machines — who needs to know *what differs on the server side*.
14
+ - **What it reads:** the server's startup log, and optionally a snapshot of the
15
+ server's Python environment. Offline, no GPU, no dependencies.
16
+ - **What it does not do:** it does not say *which* difference caused a performance
17
+ change. That still needs an A/B run. It tells you what to A/B.
18
+
19
+ ## Try it in one minute (no GPU)
20
+
21
+ ```bash
22
+ git clone https://github.com/apex-mochen/servediff && cd servediff
23
+ pip install .
24
+ servediff diff examples/issue-excerpts/vllm-47047-v0.23-default.log examples/issue-excerpts/vllm-47047-v0.23-marlin.log
25
+ ```
26
+
27
+ ```text
28
+ fact baseline candidate status
29
+ backend.moe VLLM_CUTLASS (NvFp4) MARLIN (NvFp4) changed
30
+
31
+ 1 difference(s); 0 fact(s) identical. Absent means the log did not print it, not that it was off.
32
+ ```
33
+
34
+ That is the difference the reporter of
35
+ [vllm#47047](https://github.com/vllm-project/vllm/issues/47047) found by hand after a
36
+ v0.21 → v0.23 throughput drop. The example files are the log lines posted in that
37
+ issue (see [tests/fixtures/README.md](https://github.com/apex-mochen/servediff/blob/main/tests/fixtures/README.md)).
38
+
39
+ ## Real example: same flags, vLLM 0.28.0 vs 0.30.0
40
+
41
+ Two startup logs from one RTX 4060 Laptop under WSL2, identical flags
42
+ (Qwen2.5-0.5B-Instruct, fp16, `--max-model-len 2048`, `--gpu-memory-utilization 0.45`):
43
+
44
+ ```bash
45
+ servediff diff vllm-0.28.0.log vllm-0.30.0.log
46
+ ```
47
+
48
+ ```text
49
+ warning: baseline server failed to start: RuntimeError: UVA is not available; facts after the failure are absent because startup stopped, not because they were off
50
+
51
+ fact baseline candidate status
52
+ backend.attention <absent> FLASH_ATTN only_candidate
53
+ backend.flash_attn_version <absent> 2 only_candidate
54
+ backend.sampling_flashinfer <absent> disabled only_candidate
55
+ cuda_graph.captures <absent> ["PIECEWISE x51", "FULL x2", "FULL x35"] only_candidate
56
+ cuda_graph.pool_gib <absent> 0.17 only_candidate
57
+ engine.version 0.28.0 0.30.0 changed
58
+ startup failed ready changed
59
+ startup.error ["RuntimeError: UVA is not available", " <absent> only_baseline
60
+ uva_buffers <absent> fallback: device memory only_candidate
61
+
62
+ 9 difference(s); 8 fact(s) identical. Absent means the log did not print it, not that it was off.
63
+ ```
64
+
65
+ 0.28.0 does not start on WSL2 with default settings; 0.30.0 does, because it falls
66
+ back to device memory when pinned memory is unavailable. Upstream fixed this in
67
+ [vllm#56908](https://github.com/vllm-project/vllm/pull/56908), first released in
68
+ v0.30.0. Forcing the V1 model runner on 0.28.0 (`VLLM_USE_V2_MODEL_RUNNER=0`) makes it
69
+ start, and the remaining server-side differences are:
70
+
71
+ ```text
72
+ fact baseline candidate status
73
+ cuda_graph.captures ["mixed prefill-decode, PIECEWISE x51", ["PIECEWISE x51", "FULL x2", "FULL x35"] changed
74
+ cuda_graph.pool_gib 0.36 0.17 changed
75
+ engine.version 0.28.0 0.30.0 changed
76
+ model_runner <absent> V2 only_candidate
77
+ uva_buffers <absent> fallback: device memory only_candidate
78
+
79
+ 5 difference(s); 11 fact(s) identical. Absent means the log did not print it, not that it was off.
80
+ ```
81
+
82
+ ## Dependency versions: `servediff env`
83
+
84
+ Logs do not print torch / triton / flashinfer versions, and upgrades of those change
85
+ server behaviour too. Snapshot each server environment with its own interpreter —
86
+ nothing needs to be installed into it:
87
+
88
+ ```bash
89
+ servediff env --python /path/to/old-venv/bin/python -o old.json
90
+ servediff env --python /path/to/new-venv/bin/python -o new.json
91
+ servediff diff old.json new.json
92
+ ```
93
+
94
+ Excerpt from the same two environments (20 inference-relevant rows; 74 other packages
95
+ hidden unless you pass `--all`):
96
+
97
+ ```text
98
+ pkg.flashinfer-python 0.6.16.post3 0.6.18.post1 changed
99
+ pkg.nvidia-cuda-nvcc 13.3.73 13.0.88 changed
100
+ pkg.nvidia-cutlass-dsl 4.6.2 4.7.1 changed
101
+ pkg.torch 2.13.0 2.13.0+cu130 changed
102
+ pkg.transformers 5.16.1 5.17.0 changed
103
+ pkg.vllm 0.28.0 0.30.0 changed
104
+ ```
105
+
106
+ Note the older vLLM environment carries *newer* CUDA toolkit wheels (13.3 vs 13.0).
107
+ Whether that matters for performance is not known — that is what an A/B run is for.
108
+ Versions are read from package metadata, so the same torch build can show as `2.13.0`
109
+ in one environment and `2.13.0+cu130` in another.
110
+
111
+ The snapshot records Python, GPU name and driver (via `nvidia-smi`), all installed
112
+ package versions, and env vars starting with `VLLM_`, `SGLANG_`, `SGL_`, `CUDA_`,
113
+ `NCCL_`, `TORCH_`, `PYTORCH_`, `FLASHINFER_`, `TRITON_`. Values of variables whose name
114
+ contains `TOKEN`, `KEY`, `SECRET`, `PASSWORD`, `CREDENTIAL` or `AUTH` are replaced with
115
+ `<redacted>`. Snapshots and logs contain local paths: review them before sharing.
116
+
117
+ ## What it extracts
118
+
119
+ | Fact | vLLM | SGLang |
120
+ |---|---|---|
121
+ | version | banner / engine init | — (not printed) |
122
+ | arguments | `non-default args` | `server_args` (all args) |
123
+ | attention backend | `Using X attention backend` | `attention_backend` arg |
124
+ | MoE backend | three log formats seen in 0.23–0.30 | `moe_runner_backend` arg |
125
+ | CUDA graph | eager mode, `cudagraph_mode`, capture sets, pool size | prefill CUDA graph disabled |
126
+ | model runner, UVA fallback | `Using V2 Model Runner`, pinned-memory fallback | — |
127
+ | startup outcome | ready / failed + root-cause error | ready |
128
+
129
+ Every fact keeps the log line it came from (`servediff show <log>` or `--json`).
130
+ A fact the log did not print is `<absent>`: servediff never fills in defaults.
131
+ Options shared by both engines (dtype, context length, memory fraction, prefix cache,
132
+ CUDA graph, TP size) are mapped to common names, so a vLLM log and an SGLang log can be
133
+ compared, though the result is noisier than a same-engine diff.
134
+
135
+ Exit codes: `0` no differences, `1` differences, `2` nothing recognised.
136
+
137
+ ## Limits
138
+
139
+ - Tested on: log excerpts posted in vllm#47047 (v0.23) and vllm#53472 (v0.23, v0.26);
140
+ full startup logs of vLLM 0.28.0 and 0.30.0 and one SGLang log, all single-GPU with a
141
+ dense model. TP > 1, MoE models in full logs, and other versions are not yet verified.
142
+ - Parsing is regex-based on log text, which changes between versions. A missed line
143
+ shows up as `<absent>`, never as a wrong value — please report it.
144
+
145
+ ## License
146
+
147
+ Apache-2.0.
@@ -0,0 +1,46 @@
1
+ # servediff(中文说明)
2
+
3
+ **参数一样,server 却不一样。** `servediff` 告诉你 vLLM / SGLang server **实际**用了什么配置,以及两次运行之间哪里变了。
4
+
5
+ benchmark 结果文件只记录客户端。升级之后,server 可能会悄悄换掉 MoE 或 attention backend、改变 CUDA graph 的捕获方式、走另一条回退路径,或者底下的 torch / triton / flashinfer 版本已经不同。现在要发现这些,只能人工读启动日志、逐个 bisect。servediff 替你把日志读一遍。
6
+
7
+ - **适合谁**:比较两次 vLLM / SGLang 运行的人,比如升级前后、改了某个参数、换了机器。
8
+ - **读什么**:server 的启动日志;也可以读一份 server Python 环境的快照。离线运行,不需要 GPU,没有任何依赖。
9
+ - **不做什么**:不判断性能变化是哪一项造成的,那仍然需要 A/B 实验。它告诉你该 A/B 哪几项。
10
+
11
+ ## 一分钟试用(不需要 GPU)
12
+
13
+ ```bash
14
+ git clone https://github.com/apex-mochen/servediff && cd servediff
15
+ pip install .
16
+ servediff diff examples/issue-excerpts/vllm-47047-v0.23-default.log examples/issue-excerpts/vllm-47047-v0.23-marlin.log
17
+ ```
18
+
19
+ 输出只有一行差异:MoE backend 从 `VLLM_CUTLASS (NvFp4)` 变为 `MARLIN (NvFp4)`。这正是 [vllm#47047](https://github.com/vllm-project/vllm/issues/47047) 的报告者在 v0.21 → v0.23 吞吐下降后,靠人工找出来的差异。
20
+
21
+ ## 真实案例:参数相同,vLLM 0.28.0 对 0.30.0
22
+
23
+ 在一台 RTX 4060 Laptop(WSL2)上,两个版本用完全相同的参数启动:
24
+
25
+ - 0.28.0 默认配置**起不来**,报 `RuntimeError: UVA is not available`。
26
+ - 0.30.0 能起来,因为 pinned memory 不可用时会回退到 device memory。上游修复是 [vllm#56908](https://github.com/vllm-project/vllm/pull/56908),v0.30.0 是第一个包含它的正式版。
27
+
28
+ servediff 会先给出"baseline 启动失败"的 warning 和根因,再列出两边的配置差异。完整输出见英文 README。
29
+
30
+ ## 依赖版本:`servediff env`
31
+
32
+ ```bash
33
+ servediff env --python /旧环境/bin/python -o old.json
34
+ servediff env --python /新环境/bin/python -o new.json
35
+ servediff diff old.json new.json
36
+ ```
37
+
38
+ 默认只显示和推理相关的包、GPU、引擎环境变量;其他包要加 `--all` 才列出。名字里含 `TOKEN`、`KEY`、`SECRET`、`PASSWORD` 等的环境变量,值一律替换成 `<redacted>`。快照和日志里有本机路径,分享之前请先检查。
39
+
40
+ ## 边界
41
+
42
+ - 已测试:vllm#47047、#53472 里贴出的日志片段(v0.23、v0.26),vLLM 0.28.0 / 0.30.0 的完整启动日志,以及一份 SGLang 日志。都是单卡、dense 模型。
43
+ - TP>1、完整日志里的 MoE 模型、其他版本,都还没有验证。
44
+ - 识别不到的行会显示为 `<absent>`,不会显示成错误的值。
45
+
46
+ 许可证:Apache-2.0。
@@ -0,0 +1 @@
1
+ Using 'VLLM_CUTLASS' NvFp4 MoE backend
@@ -0,0 +1,2 @@
1
+ Using 'MARLIN' NvFp4 MoE backend
2
+ Maximum concurrency for 81,920 tokens per request: 54.14x
@@ -0,0 +1,2 @@
1
+ INFO [unquantized.py:291] Using FlashInfer CUTLASS Unquantized MoE backend out of potential
2
+ backends: ['FlashInfer TRTLLM', 'FlashInfer CUTLASS', 'TRITON', 'BATCHED_TRITON'].
@@ -0,0 +1,2 @@
1
+ Using MoEPrepareAndFinalizeNoDPEPModular
2
+ Using FlashInferExperts MoE backend
@@ -0,0 +1,2 @@
1
+ INFO [unquantized.py:374] Using MoEPrepareAndFinalizeNoDPEPMonolithic
2
+ INFO [unquantized.py:375] Using TrtLlmBf16ExpertsMonolithic MoE backend