Repository navigation
feat(pt_expt): add rank-aware TensorBoard training observer - #6066
OutisLi-Bot wants to merge 9 commits into
Conversation
Introduce a TrainingObserver lifecycle on the shared trainer loop and a chief-owned TensorBoardObserver for pt_expt so tensorboard / tensorboard_freq / tensorboard_log_dir honor rank awareness, independent logging frequency, and clean writer teardown without paying import or host-sync costs when disabled. Refs deepmodeling#5821 deepmodeling#5755
for more information, see https://pre-commit.ci
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No merge-blocking issue was established; the reviewed change is ready to merge after normal checks. Pre-merge checks |
|
At disp ∩ tensorboard_freq, on_display used to rewrite learning_rate and train/* from DisplayObservation, which may carry interval averages when disp_avg=True. Leave those tags to on_step_end; on_display only emits valid/* and timing/*.
for more information, see https://pre-commit.ci
…ain/lr ownership) Include 01918f6 so the profiler branch carries the TensorBoard observer display-tag fix without rewriting published history.
Satisfy empty-except lint on the intentional best-effort catch.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6066 +/- ##
==========================================
- Coverage 77.85% 76.00% -1.86%
==========================================
Files 1170 1173 +3
Lines 140914 141100 +186
Branches 5056 5051 -5
==========================================
- Hits 109707 107241 -2466
- Misses 29323 32282 +2959
+ Partials 1884 1577 -307 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Move RankContext, TrainingTask, TrainingTaskCollection, and TrainStepResult into a leaf types module so observer annotations no longer TYPE_CHECKING-import trainer while trainer runtime-imports observer. Public re-exports from trainer and the package stay identical.
for more information, see https://pre-commit.ci
pre-commit dropped the unused import of DEFAULT_TASK_KEY from trainer, breaking deepmd.dpmodel.train.data and historical trainer imports. Re-export it explicitly and point data.py at the leaf types module.
for more information, see https://pre-commit.ci
Summary
Implements #5821:
training.tensorboard/tensorboard_freq/tensorboard_log_dirfor pt_expt through a rank-awareTrainingObserver.TrainingObserverlifecycle on the sharedAbstractTrainerloop (on_train_begin,on_step_end,on_display,on_checkpoint,on_train_end).TensorBoardObserverunderdeepmd/pt_expt/train(reusable by legacy PT). Only the chief rank owns aSummaryWriter.tensorboard_freqis independent ofdisp_freq; step hooks run only when due.pt_exptfor the TensorBoard options.Tests
source/tests/common/dpmodel/test_train_observer.pysource/tests/pt_expt/train/test_tensorboard_observer.py(single-process + simulated multi-rank chief-only writer, frequency, cleanup, restart)Refs #5821 #5755
Summary by CodeRabbit