Files
tokenspeed/python
WangBo e43d3bf6a2 feat(dspark): support grammar and logprobs in adaptive verify (#3539)
## Summary

- Gather adaptive-verification grammar masks into the same CSR-packed
target-logit layout used by DP-local CUDA graphs.
- Copy grammar verify candidates to pinned storage on the main stream
before the fork event, so the side-stream host fill reads pre-packing
tokens even when packed verification rewrites `input_ids_buf` in place.
- Map flat accepted-path indices through packed CSR rows and emit
selected-token output logprobs for greedy and sampled FlashInfer
verification and sampled prefill.
- Allow xGrammar and output logprobs at startup; keep cumulative
probabilities explicitly unsupported and document the packed-layout
contract.

## Tests

- `pre-commit run --all-files`
- Packed greedy and FlashInfer sampling tests: **38 passed**.
- Adaptive layout and startup tests: **21 passed, 49 deselected**.
- DeepSeek-V4.1-Flash on 8×B300 with TP1, DP8 and EP8, MegaMoE and
DP-local CUDA graphs: 32 concurrent JSON-schema requests returned exact
JSON with a finite logprob for every completion token.
- Fresh restart with the committed source, sampled JSON and narrative
validation: **32 of 32 requests passed**. Adaptive replay selected
target query capacities **12 and 8 versus full width 24 on all eight DP
ranks**; responses retained valid grammar and per-token finite logprobs.

---------

Signed-off-by: wangbo981016 <wangbo981016@gmail.com>
2026-11-18 15:10:41 +08:00
..
2026-05-06 13:27:02 +00:00