Commit b608942
Improve preset creation harness and CLI output
A preset claims to be a verified serving configuration, but three of the
properties that decide what "verified" means were optional or defaulted, so
two creations with the same configuration could produce very different
artifacts.
- `max_ttft` and `min_context_length` are now required. Without a latency
bound, maximising throughput has a degenerate optimum; without a context
floor, one creation served 64K where another served 1M under identical
constraints.
- `concurrency` is now required rather than defaulting to 8.
- `trials` in the configuration, `trials_num` in the constraints the agent
reads, since it is the number of trials rather than a ceiling.
- `baseline: true` makes the first trial a reference point rather than an
optimization attempt.
- `input_tokens`/`output_tokens` pin the benchmark workload so trials and the
final service are comparable; both default to 1024.
- rename the config's `context_length` to `min_context_length`, since it is a
requirement, and keep `context_length` for the measured value.
Per-user speed is now the steady decode rate, `1/TPOT`, as the serving
literature defines it. Dividing aggregate throughput by concurrency folded in
time to first token and read about 9% low. Both display paths now use the same
definition; they previously disagreed.
The trial record gains `learned`, required for every trial, and `failed` for a
benchmark that broke a constraint. A failed trial keeps its benchmark, since
that is what the next trial learns from, and is excluded from best-trial
selection.
`findings.md` is removed. It asked the agent to enumerate what it had not
tried, which is unbounded and produced an arbitrary subset presented as
complete. What a trial taught now lives on the trial record.
Trials themselves are measured more honestly:
- record the largest context each trial handles, found by sending real requests
- run the final benchmark inside the service replica, directly against the
engine, so it is comparable with the trial benchmarks
- require that a benchmark not reuse the previous one's prompts, which had been
inflating later trials through the engine's prefix cache
- record final service attempts in `verifications.jsonl` and mirror them out, so
the CLI reads the phase instead of inferring it from a spent trial budget
Also fixes a real bug: session constraints were read from the agent workspace,
which is deleted when a session finishes, so a verified preset could never show
what it was created against.
`dstack preset` output is reworked: `ps`-style filtering, CONSTRAINTS and
BENCHMARK columns, and one sparkline glyph per trial. The constraints are
dimmed so the measurement leads, and a trial that broke a constraint is marked
with a yellow bar. Maintainer notes written as `<!--!...-->` are stripped from
the rendered agent prompt.
The `endpoints` to `presets` rename in #4058 deleted two docs pages without
adding redirects, so `/docs/concepts/endpoints/` and
`/docs/reference/cli/dstack/endpoint/` returned 404. Both now redirect to
their `preset` equivalents.
`shared_prefix_tokens` is documented on the concepts page. It existed only in
the generated schema reference, so the property that decides the benchmark's
prefix cache hit rate was invisible to anyone reading the concept.
A run where no trial met the constraints showed neither hardware nor a number,
because both were read from the best trial and a failed one cannot become best.
Such a run now shows its fastest failed benchmark, dimmed and marked `*` so it
does not read as a result where styling is absent. That is the answer such a run
produced: `ttft=4.3s` against a 675ms bound is why a card is unusable.
The listing always shows `prefix`, including `prefix=0%`. It decides how much of
each request the engine serves from its prefix cache, so two rows are only
comparable when it matches.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 752de28 commit b608942
22 files changed
Lines changed: 1255 additions & 257 deletions
File tree
- mkdocs/docs/concepts
- src
- dstack/_internal/cli
- commands
- models
- services/presets
- resources
- tests/_internal/cli
- commands
- services/presets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
| |||
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
57 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
58 | 74 | | |
59 | | - | |
| 75 | + | |
60 | 76 | | |
61 | 77 | | |
62 | 78 | | |
| |||
66 | 82 | | |
67 | 83 | | |
68 | 84 | | |
| 85 | + | |
| 86 | + | |
69 | 87 | | |
70 | 88 | | |
71 | | - | |
| 89 | + | |
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
75 | 93 | | |
76 | 94 | | |
77 | 95 | | |
78 | | - | |
| 96 | + | |
79 | 97 | | |
80 | 98 | | |
81 | | - | |
82 | | - | |
| 99 | + | |
| 100 | + | |
83 | 101 | | |
84 | 102 | | |
85 | 103 | | |
86 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
87 | 108 | | |
88 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
89 | 119 | | |
90 | 120 | | |
91 | 121 | | |
| |||
104 | 134 | | |
105 | 135 | | |
106 | 136 | | |
107 | | - | |
| 137 | + | |
108 | 138 | | |
109 | | - | |
| 139 | + | |
110 | 140 | | |
111 | | - | |
| 141 | + | |
112 | 142 | | |
113 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
114 | 146 | | |
115 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
116 | 150 | | |
117 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
118 | 154 | | |
119 | 155 | | |
120 | 156 | | |
121 | | - | |
| 157 | + | |
122 | 158 | | |
123 | 159 | | |
124 | 160 | | |
| |||
129 | 165 | | |
130 | 166 | | |
131 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
132 | 172 | | |
133 | 173 | | |
134 | 174 | | |
| |||
139 | 179 | | |
140 | 180 | | |
141 | 181 | | |
142 | | - | |
| 182 | + | |
143 | 183 | | |
144 | 184 | | |
145 | 185 | | |
146 | | - | |
| 186 | + | |
147 | 187 | | |
148 | 188 | | |
149 | | - | |
150 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
151 | 194 | | |
152 | | - | |
153 | | - | |
| 195 | + | |
| 196 | + | |
154 | 197 | | |
155 | | - | |
| 198 | + | |
156 | 199 | | |
157 | 200 | | |
158 | 201 | | |
| |||
167 | 210 | | |
168 | 211 | | |
169 | 212 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 213 | + | |
| 214 | + | |
179 | 215 | | |
180 | 216 | | |
181 | 217 | | |
182 | 218 | | |
183 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
184 | 239 | | |
185 | 240 | | |
186 | 241 | | |
| |||
189 | 244 | | |
190 | 245 | | |
191 | 246 | | |
192 | | - | |
| 247 | + | |
193 | 248 | | |
194 | 249 | | |
195 | 250 | | |
196 | 251 | | |
197 | 252 | | |
198 | 253 | | |
199 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
200 | 263 | | |
201 | 264 | | |
202 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
239 | 245 | | |
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
243 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
244 | 258 | | |
245 | 259 | | |
246 | 260 | | |
| |||
267 | 281 | | |
268 | 282 | | |
269 | 283 | | |
270 | | - | |
| 284 | + | |
271 | 285 | | |
272 | | - | |
| 286 | + | |
273 | 287 | | |
274 | 288 | | |
275 | 289 | | |
276 | 290 | | |
277 | 291 | | |
278 | | - | |
| 292 | + | |
279 | 293 | | |
280 | | - | |
| 294 | + | |
281 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
282 | 299 | | |
283 | 300 | | |
284 | 301 | | |
| |||
408 | 425 | | |
409 | 426 | | |
410 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
411 | 443 | | |
412 | 444 | | |
413 | 445 | | |
| |||
490 | 522 | | |
491 | 523 | | |
492 | 524 | | |
493 | | - | |
494 | | - | |
| 525 | + | |
| 526 | + | |
495 | 527 | | |
496 | 528 | | |
497 | 529 | | |
| |||
0 commit comments