sgl-eval 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 (106) hide show
  1. sgl_eval-0.1.0/LICENSE +202 -0
  2. sgl_eval-0.1.0/NOTICE +33 -0
  3. sgl_eval-0.1.0/PKG-INFO +199 -0
  4. sgl_eval-0.1.0/README.md +150 -0
  5. sgl_eval-0.1.0/pyproject.toml +127 -0
  6. sgl_eval-0.1.0/setup.cfg +4 -0
  7. sgl_eval-0.1.0/sgl_eval/__init__.py +10 -0
  8. sgl_eval-0.1.0/sgl_eval/_vendored/__init__.py +6 -0
  9. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/SOURCES.yaml +198 -0
  10. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/__init__.py +5 -0
  11. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/_metrics_base.py +465 -0
  12. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/_metrics_utils.py +79 -0
  13. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/_utils.py +44 -0
  14. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/__init__.py +4 -0
  15. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/_utils.py +346 -0
  16. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/aime24/__init__.py +22 -0
  17. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/aime24/test.txt +30 -0
  18. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/aime25/__init__.py +22 -0
  19. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/aime25/test.txt +30 -0
  20. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/aime26/__init__.py +22 -0
  21. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/aime26/test.txt +30 -0
  22. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/gpqa/__init__.py +23 -0
  23. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/gpqa/prepare.py +101 -0
  24. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/gsm8k/__init__.py +22 -0
  25. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/gsm8k/prepare.py +95 -0
  26. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/mmlu/__init__.py +23 -0
  27. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/mmlu/prepare.py +176 -0
  28. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/mmlu_pro/__init__.py +22 -0
  29. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/mmlu_pro/prepare.py +75 -0
  30. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/mmmu_pro_vision/__init__.py +25 -0
  31. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/mmmu_pro_vision/prepare.py +87 -0
  32. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/ruler2/__init__.py +20 -0
  33. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/ruler2/prepare.py +582 -0
  34. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/ruler2/prepare_mmlu.py +482 -0
  35. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/ruler2/prepare_niah.py +281 -0
  36. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/ruler2/prepare_qa.py +392 -0
  37. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/ruler2/ruler2_score.py +48 -0
  38. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/dataset/ruler2/tokenizer.py +74 -0
  39. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/evaluator/__init__.py +1 -0
  40. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/evaluator/base.py +96 -0
  41. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/evaluator/math.py +88 -0
  42. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/evaluator/mcq.py +132 -0
  43. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/evaluator/ruler.py +193 -0
  44. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/math_grader.py +166 -0
  45. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/math_metrics.py +120 -0
  46. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/prompts/default.yaml +8 -0
  47. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/prompts/math.yaml +20 -0
  48. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/prompts/matharena-aime.yaml +13 -0
  49. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/prompts/mcq-10choices.yaml +12 -0
  50. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/prompts/mcq-4choices-boxed.yaml +12 -0
  51. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/prompts/mcq-4choices.yaml +12 -0
  52. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/prompts/mmmu-pro.yaml +16 -0
  53. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/ruler2_metrics.py +50 -0
  54. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/tests/test_base_metrics.py +199 -0
  55. sgl_eval-0.1.0/sgl_eval/_vendored/nemo_skills/tests/test_math_equal.py +83 -0
  56. sgl_eval-0.1.0/sgl_eval/cli.py +198 -0
  57. sgl_eval-0.1.0/sgl_eval/evals/__init__.py +7 -0
  58. sgl_eval-0.1.0/sgl_eval/evals/_loader.py +304 -0
  59. sgl_eval-0.1.0/sgl_eval/evals/_math.py +125 -0
  60. sgl_eval-0.1.0/sgl_eval/evals/_mmmu_pro.py +139 -0
  61. sgl_eval-0.1.0/sgl_eval/evals/_multichoice.py +144 -0
  62. sgl_eval-0.1.0/sgl_eval/evals/_prompts.py +71 -0
  63. sgl_eval-0.1.0/sgl_eval/evals/_registry.py +357 -0
  64. sgl_eval-0.1.0/sgl_eval/evals/_ruler2.py +482 -0
  65. sgl_eval-0.1.0/sgl_eval/evals/_vision.py +91 -0
  66. sgl_eval-0.1.0/sgl_eval/evals/prompts/mmmu-pro-cot.yaml +13 -0
  67. sgl_eval-0.1.0/sgl_eval/metrics.py +136 -0
  68. sgl_eval-0.1.0/sgl_eval/model_preset.py +139 -0
  69. sgl_eval-0.1.0/sgl_eval/model_presets.yaml +33 -0
  70. sgl_eval-0.1.0/sgl_eval/pipeline/__init__.py +9 -0
  71. sgl_eval-0.1.0/sgl_eval/pipeline/report.py +106 -0
  72. sgl_eval-0.1.0/sgl_eval/pipeline/run.py +26 -0
  73. sgl_eval-0.1.0/sgl_eval/pipeline/setup.py +140 -0
  74. sgl_eval-0.1.0/sgl_eval/predictions.py +105 -0
  75. sgl_eval-0.1.0/sgl_eval/preset.py +417 -0
  76. sgl_eval-0.1.0/sgl_eval/registry.py +74 -0
  77. sgl_eval-0.1.0/sgl_eval/runner/__init__.py +143 -0
  78. sgl_eval-0.1.0/sgl_eval/runner/_executor.py +88 -0
  79. sgl_eval-0.1.0/sgl_eval/runner/_progress.py +97 -0
  80. sgl_eval-0.1.0/sgl_eval/sampler.py +187 -0
  81. sgl_eval-0.1.0/sgl_eval/types.py +119 -0
  82. sgl_eval-0.1.0/sgl_eval.egg-info/PKG-INFO +199 -0
  83. sgl_eval-0.1.0/sgl_eval.egg-info/SOURCES.txt +104 -0
  84. sgl_eval-0.1.0/sgl_eval.egg-info/dependency_links.txt +1 -0
  85. sgl_eval-0.1.0/sgl_eval.egg-info/entry_points.txt +2 -0
  86. sgl_eval-0.1.0/sgl_eval.egg-info/requires.txt +23 -0
  87. sgl_eval-0.1.0/sgl_eval.egg-info/top_level.txt +1 -0
  88. sgl_eval-0.1.0/tests/test_cli_partial.py +49 -0
  89. sgl_eval-0.1.0/tests/test_dump_run.py +121 -0
  90. sgl_eval-0.1.0/tests/test_load_from_path.py +45 -0
  91. sgl_eval-0.1.0/tests/test_mmlu_download.py +212 -0
  92. sgl_eval-0.1.0/tests/test_mmlu_pro.py +95 -0
  93. sgl_eval-0.1.0/tests/test_mmmu_pro.py +246 -0
  94. sgl_eval-0.1.0/tests/test_mmmu_pro_vision.py +172 -0
  95. sgl_eval-0.1.0/tests/test_pipeline.py +103 -0
  96. sgl_eval-0.1.0/tests/test_predictions_writer.py +141 -0
  97. sgl_eval-0.1.0/tests/test_preset.py +282 -0
  98. sgl_eval-0.1.0/tests/test_prompt_override.py +171 -0
  99. sgl_eval-0.1.0/tests/test_ruler2.py +468 -0
  100. sgl_eval-0.1.0/tests/test_runner.py +284 -0
  101. sgl_eval-0.1.0/tests/test_sample_seed.py +61 -0
  102. sgl_eval-0.1.0/tests/test_sampler.py +151 -0
  103. sgl_eval-0.1.0/tests/test_vendor_audit.py +19 -0
  104. sgl_eval-0.1.0/tests/test_vendored_evaluator.py +67 -0
  105. sgl_eval-0.1.0/tests/test_vendored_grader.py +48 -0
  106. sgl_eval-0.1.0/tests/test_vision_message.py +145 -0
sgl_eval-0.1.0/LICENSE ADDED
@@ -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.
sgl_eval-0.1.0/NOTICE ADDED
@@ -0,0 +1,33 @@
1
+ sgl-eval
2
+ Copyright 2026 The SGLang Project
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License"); see the
5
+ top-level LICENSE file for the full text.
6
+
7
+ ================================================================================
8
+ Third-party vendored sources
9
+ ================================================================================
10
+
11
+ This product includes software developed at NVIDIA Corporation:
12
+ NeMo-Skills (https://github.com/NVIDIA/NeMo-Skills)
13
+ Released under the Apache License, Version 2.0.
14
+
15
+ The vendored slice lives under `sgl_eval/_vendored/nemo_skills/`. The
16
+ exact upstream commit, file list, and per-file provenance are recorded
17
+ in `sgl_eval/_vendored/nemo_skills/SOURCES.yaml`. Every vendored .py
18
+ file carries a banner header pointing back to its upstream path; .yaml
19
+ prompt configs and bundled .txt data files carry the same provenance.
20
+
21
+ Modifications applied to vendored Python sources at sync time:
22
+ - Intra-package imports under `nemo_skills.X` are textually rewritten
23
+ to `sgl_eval._vendored.nemo_skills.X` so the vendored modules
24
+ resolve under sgl-eval's package namespace. The mapping is recorded
25
+ in SOURCES.yaml under `import_rewrites`.
26
+ - `Lean4ProofEvaluator` (and the dependent imports under
27
+ `nemo_skills.code_execution.*`) is removed from
28
+ `evaluator/math.py`. We do not run Lean proofs.
29
+ - `_compute_reward_at_k` is removed from `metrics/math_metrics.py`.
30
+ We do not use reward-model-driven aggregation.
31
+
32
+ No content edits beyond the above are made: every other line in a
33
+ vendored file matches its upstream counterpart at the synced commit.
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: sgl-eval
3
+ Version: 0.1.0
4
+ Summary: One-click accuracy evaluation harness for SGLang.
5
+ Author: SGLang Team
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/sgl-project/sgl-eval
8
+ Project-URL: Repository, https://github.com/sgl-project/sgl-eval
9
+ Project-URL: Issues, https://github.com/sgl-project/sgl-eval/issues
10
+ Keywords: llm,evaluation,benchmark,sglang,openai-compatible,aime,gpqa,mmlu,gsm8k
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ License-File: NOTICE
27
+ Requires-Dist: openai<3,>=1.0
28
+ Requires-Dist: httpx<1,>=0.24
29
+ Requires-Dist: tqdm<5,>=4.65
30
+ Requires-Dist: pyyaml<7,>=6.0
31
+ Requires-Dist: math_verify[antlr4_9_3]<1,>=0.5
32
+ Requires-Dist: latex2sympy2_extended<2,>=1.0
33
+ Requires-Dist: numpy<3,>=1.24
34
+ Requires-Dist: pandas<3,>=2.0
35
+ Requires-Dist: datasets<5,>=2.14
36
+ Requires-Dist: pillow<12,>=10
37
+ Requires-Dist: editdistance<1,>=0.6
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest<9,>=7.0; extra == "dev"
40
+ Requires-Dist: pytest-asyncio<2,>=0.23; extra == "dev"
41
+ Requires-Dist: ruff<1,>=0.5; extra == "dev"
42
+ Requires-Dist: black<26,>=24.0; extra == "dev"
43
+ Provides-Extra: longcontext
44
+ Requires-Dist: transformers<6,>=4.40; extra == "longcontext"
45
+ Requires-Dist: nltk<4,>=3.8; extra == "longcontext"
46
+ Requires-Dist: wonderwords<3,>=2.2; extra == "longcontext"
47
+ Requires-Dist: inflect<8,>=7.0; extra == "longcontext"
48
+ Dynamic: license-file
49
+
50
+ # sgl-eval
51
+
52
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
53
+ [![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue.svg)](https://www.python.org/)
54
+
55
+ One-click accuracy evaluation harness for [SGLang](https://github.com/sgl-project/sglang).
56
+
57
+ Point at any OpenAI-compatible endpoint. Scoring logic (graders, evaluators,
58
+ prompts, dataset configs) is vendored from [NeMo-Skills](https://github.com/NVIDIA/NeMo-Skills);
59
+ sgl-eval contributes the transport, runner, and benchmark wiring.
60
+
61
+ ---
62
+
63
+ ## Quick start
64
+
65
+ ```bash
66
+ pip install sgl-eval
67
+
68
+ sgl-eval ping --base-url http://localhost:30000/v1
69
+ sgl-eval run gsm8k --base-url http://localhost:30000/v1 --num-examples 50
70
+ ```
71
+
72
+ Four subcommands: `run`, `list`, `ping`, `preset`. `sgl-eval run --help` is
73
+ the full flag reference -- endpoint, sampling overrides (`--temperature`,
74
+ `--seed`, `--thinking`, ...), and any flags the benchmark itself adds.
75
+
76
+ ---
77
+
78
+ ## Reading a run
79
+
80
+ Each run prints the headline metric first -- single-shot accuracy, averaged
81
+ across the `k` repeats when `k > 1` -- and writes the same payload plus
82
+ provenance (model, endpoint, sampling config, vendored NS commit) as
83
+ `metrics.json` under `--out-dir`.
84
+
85
+ ```
86
+ == aime25 ==
87
+ 30 examples x 16 repeats | 823.7s | 4293 tok/s | 3.5M tokens
88
+
89
+ * pass@1[avg-of-16] = 78.96% +/- 1.21% (SEM 0.30%)
90
+ pass@16 = 93.33%
91
+ majority@16 = 93.33%
92
+ no_answer = 20.00% [warn: consider --max-tokens]
93
+ ```
94
+
95
+ While the run is going, the progress bar carries a live accuracy. For a
96
+ sanity check that is usually the whole point: watch it, decide, stop.
97
+
98
+ ```
99
+ gsm8k: 34%|###4 | 452/1319 [02:11<04:12, 3.4it/s, acc=81.42%]
100
+ ```
101
+
102
+ Every scored sample is streamed to
103
+ `<out-dir>/sgl_eval_<name>_<stamp>/output-rs*.jsonl` as it lands (disable
104
+ with `--no-dump-predictions`), so the per-sample record survives however the
105
+ run ends.
106
+
107
+ ---
108
+
109
+ ## Running less than the whole thing
110
+
111
+ - **`--num-examples N`** -- only the first `N` examples.
112
+ - **`Ctrl-C`** -- kills in-flight requests, keeps everything already scored,
113
+ and writes `metrics.json` flagged `partial: true` with how much ran, so a
114
+ half-run can't later be mistaken for a full one. Exits `130`; a second
115
+ `Ctrl-C` hard-exits if cleanup hangs. The preset `expected_vs_actual`
116
+ comparison is skipped -- a half-run isn't comparable to a baseline.
117
+ - **`--from-dataset <path>`** -- swap in your own NS-shape JSONL
118
+ (`{id?, problem, expected_answer}`) for one run. Only the questions
119
+ change; scoring still goes through the vendored grader.
120
+
121
+ ---
122
+
123
+ ## Benchmarks
124
+
125
+ `sgl-eval list` for the registered set, `sgl-eval list -v` for each one's
126
+ defaults. See [`benchmarks.md`](benchmarks.md) for the ones that need more
127
+ than an endpoint (today: `ruler2`), and for how to match a NeMo-Skills run.
128
+
129
+ ## Presets
130
+
131
+ Save a `(benchmark, endpoint, sampling, n_repeats, expected)` bundle to
132
+ `~/.sgl_eval/presets/<name>.yaml` and replay with `sgl-eval run --preset
133
+ <name>`. See [`preset.md`](preset.md) for schema, example, usage, and
134
+ override priority.
135
+
136
+ For repository-maintained model defaults, select an exact supported model ID:
137
+
138
+ ```bash
139
+ sgl-eval run BENCHMARK \
140
+ --base-url BASE_URL \
141
+ --load-preset-from-model-id MODEL_ID
142
+ ```
143
+
144
+ This sets the served model and its recommended generation parameters, but not
145
+ the deployment-specific `--base-url`. See [`preset.md`](preset.md#built-in-model-presets)
146
+ for the supported model list, resolved values, and override priority.
147
+
148
+ ---
149
+
150
+ ## Architecture
151
+
152
+ **Anything that decides a score is vendored verbatim from NeMo-Skills.**
153
+ sgl-eval contributes only transport: an OpenAI client, a threadpool runner,
154
+ a CLI, and the thin glue that wires upstream pieces into one command.
155
+
156
+ ```
157
+ +----------------------------------------------------+
158
+ | sgl-eval |
159
+ | cli, sampler, runner, registry, metrics |
160
+ | evals/ |
161
+ +----------------------------------------------------+
162
+ | vendored from NeMo-Skills |
163
+ | math_grader, evaluator/, metrics/, |
164
+ | dataset/<bench>/, prompts/*.yaml |
165
+ +----------------------------------------------------+
166
+ ```
167
+
168
+ The slice is pinned at a specific commit in
169
+ `sgl_eval/_vendored/nemo_skills/SOURCES.yaml`. To upgrade, bump
170
+ `synced_from_sha` there and run:
171
+
172
+ ```bash
173
+ python scripts/sync_vendored.py # re-fetch all vendored files
174
+ pytest # upstream's own tests run against the
175
+ # new slice -- catches behavior drift
176
+ ```
177
+
178
+ Adding a benchmark inside an existing category (`math`, `multichoice`) is one
179
+ row in `_registry.py:_TABLE`. A new category needs a runner alongside it --
180
+ graders are usually already in NeMo-Skills.
181
+
182
+ ---
183
+
184
+ ## Scope
185
+
186
+ The goal is to be the single accuracy-eval client SGLang's CI calls, in place
187
+ of `sglang.test.run_eval` and the assorted per-test harnesses.
188
+
189
+ Not in scope: performance benchmarking (latency / throughput / scheduling --
190
+ that is SGLang's `bench_serving.py`; sgl-eval records them only as side
191
+ metrics, never as the headline), training or fine-tuning, multi-server
192
+ orchestration (one endpoint per invocation), and OS-level agent loops.
193
+
194
+ ---
195
+
196
+ ## License
197
+
198
+ Apache-2.0. See `LICENSE`. Vendored NeMo-Skills sources are also Apache-2.0;
199
+ see `NOTICE` for attribution and the list of vendored files.
@@ -0,0 +1,150 @@
1
+ # sgl-eval
2
+
3
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
4
+ [![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue.svg)](https://www.python.org/)
5
+
6
+ One-click accuracy evaluation harness for [SGLang](https://github.com/sgl-project/sglang).
7
+
8
+ Point at any OpenAI-compatible endpoint. Scoring logic (graders, evaluators,
9
+ prompts, dataset configs) is vendored from [NeMo-Skills](https://github.com/NVIDIA/NeMo-Skills);
10
+ sgl-eval contributes the transport, runner, and benchmark wiring.
11
+
12
+ ---
13
+
14
+ ## Quick start
15
+
16
+ ```bash
17
+ pip install sgl-eval
18
+
19
+ sgl-eval ping --base-url http://localhost:30000/v1
20
+ sgl-eval run gsm8k --base-url http://localhost:30000/v1 --num-examples 50
21
+ ```
22
+
23
+ Four subcommands: `run`, `list`, `ping`, `preset`. `sgl-eval run --help` is
24
+ the full flag reference -- endpoint, sampling overrides (`--temperature`,
25
+ `--seed`, `--thinking`, ...), and any flags the benchmark itself adds.
26
+
27
+ ---
28
+
29
+ ## Reading a run
30
+
31
+ Each run prints the headline metric first -- single-shot accuracy, averaged
32
+ across the `k` repeats when `k > 1` -- and writes the same payload plus
33
+ provenance (model, endpoint, sampling config, vendored NS commit) as
34
+ `metrics.json` under `--out-dir`.
35
+
36
+ ```
37
+ == aime25 ==
38
+ 30 examples x 16 repeats | 823.7s | 4293 tok/s | 3.5M tokens
39
+
40
+ * pass@1[avg-of-16] = 78.96% +/- 1.21% (SEM 0.30%)
41
+ pass@16 = 93.33%
42
+ majority@16 = 93.33%
43
+ no_answer = 20.00% [warn: consider --max-tokens]
44
+ ```
45
+
46
+ While the run is going, the progress bar carries a live accuracy. For a
47
+ sanity check that is usually the whole point: watch it, decide, stop.
48
+
49
+ ```
50
+ gsm8k: 34%|###4 | 452/1319 [02:11<04:12, 3.4it/s, acc=81.42%]
51
+ ```
52
+
53
+ Every scored sample is streamed to
54
+ `<out-dir>/sgl_eval_<name>_<stamp>/output-rs*.jsonl` as it lands (disable
55
+ with `--no-dump-predictions`), so the per-sample record survives however the
56
+ run ends.
57
+
58
+ ---
59
+
60
+ ## Running less than the whole thing
61
+
62
+ - **`--num-examples N`** -- only the first `N` examples.
63
+ - **`Ctrl-C`** -- kills in-flight requests, keeps everything already scored,
64
+ and writes `metrics.json` flagged `partial: true` with how much ran, so a
65
+ half-run can't later be mistaken for a full one. Exits `130`; a second
66
+ `Ctrl-C` hard-exits if cleanup hangs. The preset `expected_vs_actual`
67
+ comparison is skipped -- a half-run isn't comparable to a baseline.
68
+ - **`--from-dataset <path>`** -- swap in your own NS-shape JSONL
69
+ (`{id?, problem, expected_answer}`) for one run. Only the questions
70
+ change; scoring still goes through the vendored grader.
71
+
72
+ ---
73
+
74
+ ## Benchmarks
75
+
76
+ `sgl-eval list` for the registered set, `sgl-eval list -v` for each one's
77
+ defaults. See [`benchmarks.md`](benchmarks.md) for the ones that need more
78
+ than an endpoint (today: `ruler2`), and for how to match a NeMo-Skills run.
79
+
80
+ ## Presets
81
+
82
+ Save a `(benchmark, endpoint, sampling, n_repeats, expected)` bundle to
83
+ `~/.sgl_eval/presets/<name>.yaml` and replay with `sgl-eval run --preset
84
+ <name>`. See [`preset.md`](preset.md) for schema, example, usage, and
85
+ override priority.
86
+
87
+ For repository-maintained model defaults, select an exact supported model ID:
88
+
89
+ ```bash
90
+ sgl-eval run BENCHMARK \
91
+ --base-url BASE_URL \
92
+ --load-preset-from-model-id MODEL_ID
93
+ ```
94
+
95
+ This sets the served model and its recommended generation parameters, but not
96
+ the deployment-specific `--base-url`. See [`preset.md`](preset.md#built-in-model-presets)
97
+ for the supported model list, resolved values, and override priority.
98
+
99
+ ---
100
+
101
+ ## Architecture
102
+
103
+ **Anything that decides a score is vendored verbatim from NeMo-Skills.**
104
+ sgl-eval contributes only transport: an OpenAI client, a threadpool runner,
105
+ a CLI, and the thin glue that wires upstream pieces into one command.
106
+
107
+ ```
108
+ +----------------------------------------------------+
109
+ | sgl-eval |
110
+ | cli, sampler, runner, registry, metrics |
111
+ | evals/ |
112
+ +----------------------------------------------------+
113
+ | vendored from NeMo-Skills |
114
+ | math_grader, evaluator/, metrics/, |
115
+ | dataset/<bench>/, prompts/*.yaml |
116
+ +----------------------------------------------------+
117
+ ```
118
+
119
+ The slice is pinned at a specific commit in
120
+ `sgl_eval/_vendored/nemo_skills/SOURCES.yaml`. To upgrade, bump
121
+ `synced_from_sha` there and run:
122
+
123
+ ```bash
124
+ python scripts/sync_vendored.py # re-fetch all vendored files
125
+ pytest # upstream's own tests run against the
126
+ # new slice -- catches behavior drift
127
+ ```
128
+
129
+ Adding a benchmark inside an existing category (`math`, `multichoice`) is one
130
+ row in `_registry.py:_TABLE`. A new category needs a runner alongside it --
131
+ graders are usually already in NeMo-Skills.
132
+
133
+ ---
134
+
135
+ ## Scope
136
+
137
+ The goal is to be the single accuracy-eval client SGLang's CI calls, in place
138
+ of `sglang.test.run_eval` and the assorted per-test harnesses.
139
+
140
+ Not in scope: performance benchmarking (latency / throughput / scheduling --
141
+ that is SGLang's `bench_serving.py`; sgl-eval records them only as side
142
+ metrics, never as the headline), training or fine-tuning, multi-server
143
+ orchestration (one endpoint per invocation), and OS-level agent loops.
144
+
145
+ ---
146
+
147
+ ## License
148
+
149
+ Apache-2.0. See `LICENSE`. Vendored NeMo-Skills sources are also Apache-2.0;
150
+ see `NOTICE` for attribution and the list of vendored files.