Commit 9603653
authored
fix(gdpval): plumb judge_responses_create_params_overrides into create() call (#1174)
## Summary
`GDPValResourcesServerConfig.judge_responses_create_params_overrides` is
documented as a way to override the kwargs passed to the rubric judge's
`client.chat.completions.create(...)` call, but today only `model` and
`api_key` are extracted from it
(`resources_servers/gdpval/app.py:148-151`). Anything else — most
importantly `max_tokens` — is silently dropped, which is unfortunate
because the default `max_tokens=8192` in `scoring.py:132,265` truncates
the rubric judge's JSON for ~50% of GDPVal-style rollouts.
This PR plumbs the rest of the dict through:
- `app.py` switches `model` / `api_key` extraction from `dict.get(...)`
to `dict.pop(...)`, then forwards what's left as a new
`create_overrides` kwarg.
- `score_with_rubric` and `score_with_rubric_visual` accept a
`create_overrides: dict | None = None`, and merge it into the kwargs of
`client.chat.completions.create` (user-supplied keys win over the
in-function defaults).
- `_verify_comparison` is left alone — it goes through
`comparison.run_trials`, which already exposes `max_output_tokens`
separately and doesn't share the rubric path.
After this PR, the override config field actually does what its name
promises:
```yaml
gdpval_resources_server:
resources_servers:
gdpval:
judge_responses_create_params_overrides:
max_tokens: 16384
temperature: 0.0
```
or via Hydra at the CLI:
```
++gdpval_resources_server.resources_servers.gdpval.judge_responses_create_params_overrides.max_tokens=16384
```
## Test plan
- [x] `pytest resources_servers/gdpval/tests/test_app.py -v` — 8 passed
(1 new + 7 existing). The new
`test_verify_rubric_passes_create_overrides_through` builds a server
with `judge_responses_create_params_overrides={"model": "custom-judge",
"api_key": "sk-custom", "max_tokens": 16384, "temperature": 0.0}`,
patches `score_with_rubric` to capture kwargs, and asserts `model` /
`api_key` were popped and the rest reached the scoring function as
`create_overrides`.
- [x] `ruff check` / `ruff format --check` clean.
- [x] Manual end-to-end: a 140-task rubric run on Ultra V3 SFT showed an
`invalid_judge_response` rate of ~44% under load (vs. 10% on a
10-rollout smoke), all attributable to truncated rubric JSON at the 8192
cap. Bumping the override to 16384 takes the truncated-JSON fallback
path out of play; rerun in progress.
---------
Signed-off-by: Serge Panev <spanev@nvidia.com>1 parent 2af2d53 commit 9603653
3 files changed
Lines changed: 71 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
| |||
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| 191 | + | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
| |||
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
| 205 | + | |
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
| |||
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
| 228 | + | |
220 | 229 | | |
221 | 230 | | |
222 | 231 | | |
| |||
226 | 235 | | |
227 | 236 | | |
228 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
229 | 242 | | |
230 | 243 | | |
231 | 244 | | |
| |||
252 | 265 | | |
253 | 266 | | |
254 | 267 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
258 | 271 | | |
259 | 272 | | |
260 | 273 | | |
261 | 274 | | |
262 | 275 | | |
263 | 276 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
267 | 283 | | |
268 | 284 | | |
269 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
125 | 161 | | |
126 | 162 | | |
127 | 163 | | |
| |||
0 commit comments