feat(distillation): add TransferQueue support for On-Policy Distillation - #2580
feat(distillation): add TransferQueue support for On-Policy Distillation#2580pthombre wants to merge 4 commits into
Conversation
b0e5794 to
3b9e56b
Compare
Signed-off-by: Pranav Prashant Thombre <pthombre@nvidia.com>
3b9e56b to
5ce45ca
Compare
|
/ok to test 5ce45ca |
|
/ok to test 5ce45ca |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pranav Prashant Thombre <pthombre@nvidia.com>
|
/ok to test d2827ba |
Add the data_plane block to the distillation_math reference config so test_reference_configs_up_to_date matches the exemplar config that gained the TransferQueue section. Add unit tests for the pure helpers in distillation_sync (_dedupe_fields, _as_row_aligned_tensor, _aggregate_teacher_topk_transport_results, _packing_args_for_policy, _stamp_policy_pad_seqlen) and transport_metrics (tensor_nbytes, valid_token_tensor_nbytes) to raise patch coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pranav Prashant Thombre <pthombre@nvidia.com>
|
/ok to test ff3a57c |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pranav Prashant Thombre <pthombre@nvidia.com>
|
@pthombre — I built the same entrypoint in #3843 without knowing this PR existed, and I'd rather say so than let two copies sit in the queue. #3843 adds Yours is much larger and does things mine doesn't — I'm not asking you to do anything. Flagging it because this PR has been open since May and is currently CONFLICTING against If you're picking this back up, say so and I'll close #3843 — no point in two. If it's dormant, #3843 is rebased on current |
What does this PR do ?
Adds TransferQueue-backed on-policy distillation so teacher top-k logits can stay in the data plane instead of being returned through the driver.
This PR extends the data-plane support that already exists for GRPO to the distillation workflow. When
data_plane.enabled=true,examples/run_distillation.pynow builds the student policy as aTQPolicyand dispatches to a new TQ-aware distillation trainer. The legacy distillation path remains the default when the data plane is disabled.Key pieces added:
distillation_train_syncimplementation that orchestrates rollout, teacher top-k inference, and student training through TransferQueue metadata.DistillationRolloutActorthat runs generation/rollout processing and seeds the TQ partition with row-aligned distillation training tensors.get_topk_logits_preshardedsupport so teacher workers writeteacher_topk_logitsandteacher_topk_indicesback to TQ directly.TQPolicyextensions for custom partition fields, consumer task names, and custom train fetch fields so the same policy wrapper can serve GRPO and distillation.Issues
None.
Usage
Enable the TQ distillation path by using the new exemplar or recipe:
The recipe added in this PR can be launched through the test-suite wrapper:
Before your PR is "Ready for review"
Pre checks: