[RFC] Training-Inference Consistency for RL
Anchors: #42259 (Logprobs), #39568 (R3), #45221 (Data Plane)
Problem
RL training correctness requires that for the same sample, weights, and routing strategy, the trainer and rollout engine observe identical results. Six sources of divergence:
- Logprobs & token-ID replay — logprob mismatch → importance sampling ratio corruption → noisy policy gradient.
trace_decode_token_ids (#46701) enables replaying a fixed token sequence while computing real logprobs.
- R3 routing replay — MoE expert routing must be captured during inference and replayed during training. Mismatch → gradients computed on wrong experts.
- DSA index replay — DeepSeek V3.2+ dynamic sparse attention indices must match between inference and training.
- Data plane — logprobs, routed_experts, and DSA indices must be transported from inference GPU workers to trainer efficiently, bypassing the EngineCore/API Server bottleneck.
- Hidden states replay — OPD requires exporting intermediate-layer hidden states from teacher to student, avoiding full
[tokens, vocab] logit transfer.
- Dtype (logits precision) — Inference must match training's fp32 precision for lm_head to maintain train-inference consistency.
Subsections
3.1 Logprobs & Token-ID Replay
Full tracker: #42259. Exit: #47680 + #42245 merged; #46701 accepted.
3.2 R3 Routing Replay
Exit: R3 works on FlashInfer + P/D + KV-offload; R3 correctness test in RL CI.
3.3 DSA Index Replay
No downstream demand yet. Forward-looking for DeepSeek V4+ RL adoption. Exit: RFC accepted.
3.4 Data Plane
Exit: at least one data plane backend merged; R3 transport E2E verified.
3.5 Hidden States Replay
Exit: Observation Plugin Phase 2 merged.
3.6 Dtype Replay
Feedback Period
Two weeks from posting.
[RFC] Training-Inference Consistency for RL
Anchors: #42259 (Logprobs), #39568 (R3), #45221 (Data Plane)
Problem
RL training correctness requires that for the same sample, weights, and routing strategy, the trainer and rollout engine observe identical results. Six sources of divergence:
trace_decode_token_ids(#46701) enables replaying a fixed token sequence while computing real logprobs.[tokens, vocab]logit transfer.Subsections
3.1 Logprobs & Token-ID Replay
Full tracker: #42259. Exit: #47680 + #42245 merged; #46701 accepted.
3.2 R3 Routing Replay
Exit: R3 works on FlashInfer + P/D + KV-offload; R3 correctness test in RL CI.
3.3 DSA Index Replay
--enable-return-indexer-topkNo downstream demand yet. Forward-looking for DeepSeek V4+ RL adoption. Exit: RFC accepted.
3.4 Data Plane
Exit: at least one data plane backend merged; R3 transport E2E verified.
3.5 Hidden States Replay
Exit: Observation Plugin Phase 2 merged.
3.6 Dtype Replay
Feedback Period
Two weeks from posting.