feat(vllm-model): supply the previous call's exact training tokens - #2181
feat(vllm-model): supply the previous call's exact training tokens#2181ananthsub wants to merge 10 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
e32bd85 to
3346a5b
Compare
3346a5b to
bca52ad
Compare
dca43c5 to
93decff
Compare
0954c70 to
35ef310
Compare
35ef310 to
ccce798
Compare
c9d74e7 to
79a1883
Compare
|
/claude review |
|
SHIP — no correctness or async-safety concerns. Reviewed the full diff plus the PR-head What I checked and why it's safe:
Two NOTEs (author's call, both fail safe, not merge-blocking):
Test coverage is real behavioral assertions, not pass-throughs. LGTM. |
|
/claude review |
|
Review incomplete: the PR revision changed during analysis. The base SHA captured at the start of this review ( |
|
/claude review |
Hands the engine the resolved parent's exact token sequence so the next prompt extends it by construction, instead of letting the chat template re-render the conversation and hoping the result matches what was sampled. Fires only on a parent resolved before dispatch, so the decision is made against the request as the server received it rather than a converted body. Otherwise the request is forwarded untouched. Each record carries whether its prefix was supplied, so the rate is auditable after a run. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
prefix_supplied was set the moment required_prefix_token_ids went onto the request, so it recorded the decision to supply rather than the result. A backend that does not implement the field drops it and answers normally, and nothing downstream can tell: prefix contiguity and the parent digest are both satisfied by construction whenever the prefix was applied, so they only ever confirm the case that already worked. Compare the prompt the engine returns from /tokenize against the tokens sent. On a mismatch, log and record the call as not supplied. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Require generation-time prompt token evidence before recording a supplied prefix so unsupported backends cannot silently produce off-policy captures. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Fail startup when the completions API would bypass prefix supply, preventing an apparently enabled but inconclusive training run. Serialize diagnostic accounting across concurrent callers. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Distinguish request intent from generation-time proof, document backend requirements, and keep diagnostics and failure modes explicit. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Exercise local and external data planes end to end, and persist prefix request intent separately from generation proof. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Supplies a request-time resolved parent's exact cumulative tokens to compatible vLLM generation backends and records generation-time proof that the backend used them.
Prefix-supply control flow
sequenceDiagram participant H as Harness participant M as Gym vLLM model server participant L as LineageStore participant V as vLLM backend participant S as TokenSink H->>M: continuation request M->>L: resolve(request items) alt RESOLVED L-->>M: parent call + exact cumulative tokens M->>V: generation request with required prefix token IDs V-->>M: response + generation-time prompt token IDs M->>M: compare observed prompt prefix with requested prefix M->>S: put(TokenEntry, prefix_requested=true, prefix_supplied=proof)) else ROOT or UNRESOLVED L-->>M: no proven parent tokens M->>V: ordinary generation request V-->>M: response M->>S: put(TokenEntry, prefix_requested=false) endSummary
RESOLVEDlineage result.ROOT,UNRESOLVED, and lookup failures leave the ordinary generation request unchanged.prefix_requestedseparately fromprefix_supplied; supply is true only when generation-time prompt-token evidence proves the requested prefix was used.Depends on #2180. Documentation and adapter tests are in #2349.