Repository navigation
Commit 29148e6
feat(ling3): add Ling-3.0-tiny DFlash recipe (#67)
* feat(ling3): add Ling-3.0-tiny DFlash recipe
Add a five-layer dense DFlash draft config and `ling-tiny-dflash` recipe
bound to Ling-3.0-tiny capture layers and frozen embedding/head/norm keys.
Register the 1T+2D starting allocation and cover the Plan/config contract
with CPU tests.
* test(ling3): move DFlash recipe checks into CI and pin draft shape
Move the Ling-3.0-tiny DFlash Plan/config checks from the repository-root
tests/ directory into tests/cpu, which is the CI-discovered path. Pin the
five-layer, 12/4-head, 128-dim dense geometry, the target layer invariants
and the gMASK range, and cross-check the shared target binding against the
DSpark tiny config so the two configs cannot drift independently.
Also document the Ling DFlash export flags, keep the Ling note next to the
DFlash paragraph and describe the recipe as a starting allocation.
* fix(data): forward per-row tools to the chat template
The tokenizer and format-only workers read a row's tools field but dropped
it before calling preprocess_conversations/parser.format, so raw Ling JSONL
lost the function signatures that apply_chat_template needs. Forward the
field on both worker paths, keep rows without tools unchanged, and cover the
raw JSONL path in tests/cpu.
Also make the CE-only Ling DFlash recipe stop publishing the unused Target
final hidden state, document the SGLang 0.5.21 DFLASH capture-hook
limitation for Ling decode, and restrict the cross-recipe binding test to
Target fields while pinning the recipe's Ling embedding/head/norm keys and
chat template directly.
* fix(data): fail closed when the fallback template would drop tools
Forwarding per-row tools means a tool-bearing row can now reach the general
parser's fallback branch when apply_chat_template rejects the request. That
branch renders messages without the tool schema, so accepting the row would
silently lose the definitions the change is meant to preserve.
Reject tool-bearing rows on the fallback path with the original exception as
the cause, and include that exception in the warning for rows without tools.
Cover both tokenize and format-only paths.
* fix(data): reject rows whose content repeats the assistant header
Both loss-mask implementations locate assistant spans by scanning the
rendered text for the template's assistant header, so a header literal
carried by a tool schema, a user turn or a tool response opens a phantom
supervised span over text the model must not be trained to produce.
Forwarding per-row tools makes this reachable on the shipped Ling recipe:
the template renders a tool description through transformers' tojson,
which does not escape angle brackets, so a description that mentions the
role marker is supervised together with the whole tool instruction block.
Reject such a row in GeneralParser.format, the only place that holds both
the messages and the rendered text, so the offline tokenize path, the
format-only path and the training-time token matcher are all covered.
Only an excess of headers is rejected; a template that emits fewer stays
as before. ThinkingParser accounts for the generation-prompt header that
stands in for the final assistant turn.
Also add ling3 to the opt-in real-tokenizer cross-validation, which
previously skipped this template entirely.
* fix(eval): forward a row's tools when rendering a decode prefix
Training now renders a row with its tool definitions, so a decode prefix
rendered without them is a different prompt and leaves the function
signature out of the evaluated context.
* fix(data): count assistant headers per rendering path
ThinkingParser drops the caller's add_generation_prompt and ends its history
render with a generation-prompt header that stands in for the final assistant
turn, but the fallback renderer emits that turn's own header plus the caller's
prompt. The ambiguity guard assumed the native shape only, so a fallback row
with add_generation_prompt=True — reachable through train_with_decode — was
rejected even though its text was unambiguous.
Derive the expected count from the path that produced the text. Both
directions are pinned: counting the fallback as native fails
test_thinking_fallback_header_count_follows_the_rendered_path, and counting
the native path with the caller's flag fails
test_thinking_native_rendering_still_rejects_a_repeated_header.
* docs(data): scope the repeated-header rejection
Assistant content repeating the assistant header is rejected as well, and
rows without tools are covered. Rows rendered through dataset.renderer
derive a token-based mask from the renderer itself and never reach the
parser, so they are not rejected for this reason.
* docs(data): describe the header check as count-based
The guard rejects a row only when the rendered text holds more occurrences
of the assistant header than its assistant turns can produce. A template
whose registered header does not match what its tokenizer renders yields
fewer occurrences than expected, so a repeated header can go undetected
there; the guide now states that instead of implying an unconditional
rejection.
---------
Co-authored-by: bohaotu <bohaotu@pony.ai>1 parent 6e7e3bc commit 29148e6
15 files changed
Lines changed: 603 additions & 11 deletions
File tree
- aspec
- commands
- config
- data
- configs/recipes
- docs/user-guide
- tests
- cpu
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| |||
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | | - | |
| 354 | + | |
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
174 | 204 | | |
175 | 205 | | |
176 | 206 | | |
| |||
206 | 236 | | |
207 | 237 | | |
208 | 238 | | |
| 239 | + | |
209 | 240 | | |
210 | | - | |
211 | | - | |
212 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
213 | 252 | | |
214 | 253 | | |
215 | 254 | | |
| |||
231 | 270 | | |
232 | 271 | | |
233 | 272 | | |
234 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
235 | 280 | | |
236 | 281 | | |
237 | 282 | | |
| |||
351 | 396 | | |
352 | 397 | | |
353 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
354 | 408 | | |
355 | 409 | | |
356 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
18 | 30 | | |
19 | 31 | | |
20 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
0 commit comments