Repository navigation
feat(sc): make the training data dump backend pluggable via DebugWriter - #4812
Merged
Merged
Conversation
yuki-97
commented
Oct 20, 2026
yuki-97
left a comment
Contributor
Author
There was a problem hiding this comment.
Self-review via /review-pr-team: 4 agents (rl-expert, bug-finder, design-reviewer, test-agent) + devil's-advocate pass.
Verdict — no findings above the confidence bar. LGTM, no action needed.
Verified clean
- Behaviour parity with the old TrainDataDump — step/rows bookkeeping, first-chunk replace, part-file naming, idx splice, expected_rows check and atomic publish are unchanged.
- Registry-then-dotted-path resolution matches the existing DATASET_REGISTRY / ENV_REGISTRY precedent and the repo's hydra get_class usage; bad targets, non-DebugWriter classes and abstract subclasses all fail loudly at construction.
- The config travels as data into the advantage shards via AdvantageStageConfig, both construction sites go through make_debug_writer, and moving json_safe_nonfinite to utils/json_utils.py avoids a utils -> algorithms import with no cycle and no stale references.
- The new tests hold under the installed hydra: each invalid-target case raises the stated exception and the missing-hook TypeError match is stable.
Lower-priority notes that are not inline
- An invalid debug_writer.target is not validated while log_full_train_data is false (documented as ignored); it fails at construction once the flag is on.
- AdvantageStageConfig.from_master_config carrying debug_writer is not directly asserted by a test.
Generated by Claude Code
yuki-97
marked this pull request as ready for review
October 20, 2026 12:00
Contributor
Author
|
/ok to test a0b6a14 |
mikhailshilkov
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this is the hook we need in MF! I plugged an Iceberg writer into it through target plus kwargs and it worked without changes. See a few notes from building on it.
1 task
yuki-97
force-pushed
the
yukih/debug-writer
branch
from
October 27, 2026 06:47
a0b6a14 to
d367fb4
Compare
Contributor
Author
|
/ok to test 44d64e0 |
…fic _write_rows Signed-off-by: Yuki Huang <[email protected]>
…e publishing in _publish_step Signed-off-by: Yuki Huang <[email protected]>
…ugWriter and JsonDebugWriter classes Signed-off-by: Yuki Huang <[email protected]>
… json_safe_nonfinite to utils/json_utils Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
…publish_step Signed-off-by: Yuki Huang <[email protected]>
…ter, with a registry and dotted-path targets Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
…ipt and publish with receipts Signed-off-by: Yuki Huang <[email protected]>
…g tensors, extract _validate Signed-off-by: Yuki Huang <[email protected]>
…f globbing, require receipts in finish_step, add dump/shard path helpers Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Zhiyu Li <[email protected]>
ZhiyuLi-Nvidia
force-pushed
the
yukih/debug-writer
branch
from
October 27, 2026 22:46
44d64e0 to
9bf3ef2
Compare
Contributor
|
/ok to test 9bf3ef2 |
ZhiyuLi-Nvidia
enabled auto-merge (squash)
October 27, 2026 23:25
ZhiyuLi-Nvidia
approved these changes
Oct 27, 2026
1 task done
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.
What does this PR do ?
Splits the single-controller training data dump into a
DebugWriterbase class and aJsonDebugWriter, and letsasync_rl.debug_writerselect the writer. No behaviour change by default: the JSONL files are written exactly as before.What changed
1. Extract
DebugWriterfromTrainDataDump.add_chunkkeeps the validation, per-row assembly and step bookkeeping; the abstract_write_rowsand_publish_stephold everything path- and format-specific (part files, theidxsplice, the atomic rename).JsonDebugWriteris the oldTrainDataDumpbehind those hooks, andtrain_data_dump.pybecomessingle_controller_utils/debug_writer.py.2. Move
json_safe_nonfinitetoutils/json_utils.py.logger.pyuses it too, and importing it fromsingle_controller_utilswould makeutils/depend onalgorithms/.3. Add
async_rl.debug_writer.target. ADEBUG_WRITER_REGISTRYname (jsonby default) wins; any other target containing a dot is imported withhydra.utils.get_classand must subclassDebugWriter. Extra keys go to the constructor afterlog_dirandshard_id.AdvantageStageConfigcarries the config into the advantage actors, so a custom class must be importable in the controller and in every shard process. Both construction sites go throughmake_debug_writer.Tests
test_train_data_dump.pyis renamed totest_debug_writer.pywith only the class name changed. New tests covermake_debug_writer(default and explicitjson, an external target with extra kwargs, invalid targets) and that a subclass missing a hook fails at construction.🤖 Generated with Claude Code