refactor(training): remove unused learning_rate_dict multitask handling#5278
refactor(training): remove unused learning_rate_dict multitask handling#5278wanghan-iapcm merged 1 commit intodeepmodeling:masterfrom
Conversation
Remove the unused learning_rate_dict configuration option that allowed per-task learning rate settings in multitask training. This simplifies the code by using a single learning_rate configuration for all tasks. Changes: - Remove learning_rate_dict branch in loss initialization - Remove per-task lr_schedule dictionary creation - Remove isinstance(dict) check in training loop - Unify single-task and multi-task code paths Both PyTorch and Paddle backends are updated consistently.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR simplifies multi-task learning rate handling in both PD and PT training modules by removing per-model learning rate dictionaries and conditional branching. Learning rate schedules are now consistently derived from a single Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Removes the unused learning_rate_dict multi-task configuration path from the PyTorch and Paddle training backends, standardizing multi-task training to use a single global learning_rate schedule.
Changes:
- Simplified multi-task loss initialization to always use
learning_rate.start_lr. - Removed per-task learning-rate schedule construction and dict-based handling.
- Unified the training-step learning-rate lookup to a single
BaseLRschedule for both single- and multi-task modes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| deepmd/pt/train/training.py | Drops learning_rate_dict branches and dict-based LR schedule usage in PT training/loss initialization and step loop. |
| deepmd/pd/train/training.py | Mirrors the PT cleanup in the Paddle backend to consistently use a single LR schedule. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5278 +/- ##
==========================================
+ Coverage 81.94% 82.13% +0.19%
==========================================
Files 750 753 +3
Lines 75456 75808 +352
Branches 3648 3649 +1
==========================================
+ Hits 61831 62267 +436
+ Misses 12457 12374 -83
+ Partials 1168 1167 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
41757f2
Remove the unused learning_rate_dict configuration option that allowed per-task learning rate settings in multitask training. This simplifies the code by using a single learning_rate configuration for all tasks.
Changes:
Both PyTorch and Paddle backends are updated consistently.
Summary by CodeRabbit