Repository navigation
fix(trainer): drain single-teacher RTensor input caches - #1800
Merged
sitabulaixizawaluduo merged 1 commit intoOct 19, 2026
Merged
sitabulaixizawaluduo merged 1 commit into
sitabulaixizawaluduo merged 1 commit into
Conversation
Teacher scoring caches rollout inputs in each worker process. Deleting source shards through the actor does not release those consumer caches, so repeated distillation steps retain tensors indefinitely. Include the single teacher in step cleanup and send shard IDs to every rollout teacher worker without refetching inputs. Wait for all workers before surfacing failures and preserve unrelated caches. Add CPU regressions for repeated training steps, both teacher types, nested inputs, cleanup failures, and SPMD behavior. Refs: areal-project#1209 Signed-off-by: qw <zhuqiweiyx@qq.com>
zhuqiweigit
requested review from
HwVanICI,
daihaowz,
fishcrap,
garrett4wade,
guozhihao-224,
sitabulaixizawaluduo and
yulangz
as code owners
October 17, 2026 09:36
sitabulaixizawaluduo
approved these changes
Oct 19, 2026
Le8r0nJames
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In single-controller distillation, teacher scoring localizes rollout RTensors into each teacher worker's
_fetch_buffer, but step cleanup omits the teacher. Actor cleanup deletes the source shards without releasing these process-local copies, so teacher memory grows across training steps.Include the single teacher in step cleanup for both training and rollout teachers. Add
RolloutController.clear_batches()to send deduplicated shard IDs to every worker without refetching inputs or deleting source storage. Wait for all worker drains before propagating a failure. CPU regressions exercise repeated training steps with real RTensor serialization, storage, and worker cache eviction.Related Issue
Follow-up to #1209, covering the single-teacher consumer cache.
Type of Change
Checklist
pre-commit run --all-files)maincreate-prskillAdditional Context
Validation: 163 passed, 1 deselected (the slow model-serving integration test); all pre-commit checks passed.
The new repeated-training regression fails on the unmodified base because teacher input caches survive the first step. Test environment flags use the cached model files and keep local callback requests out of the HTTP proxy.
Full model-serving, GPU training, and multi-node integration suites were not run; validation targets the CPU-side RTensor lifecycle and controller cleanup paths without launching a training deployment.