feat(jax): support shared_dict in multi-task training#5740
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds backend-neutral multi-task shared-parameter preprocessing and application, integrates ChangesMulti-task shared parameter support
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deepmd/jax/entrypoints/train.py`:
- Around line 109-117: The shared-task preprocessing in `TrainEntrypoint` can
leave `self.shared_links` stale because `preprocess_shared_params()` runs before
the later `init_model`/`use_pretrain_script` model replacement in the same flow.
Update the `is_multi_task` handling so the final `config["model"]` is
established before calling `preprocess_shared_params()`, or explicitly clear and
recompute `self.shared_links` after any model overwrite, ensuring the value
passed to `DPTrainer` matches the actual model.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6af13361-7181-40a4-bfcf-d87b6ac5eccc
📒 Files selected for processing (7)
deepmd/dpmodel/utils/multi_task.pydeepmd/jax/entrypoints/train.pydeepmd/jax/train/trainer.pydeepmd/jax/utils/multi_task.pydeepmd/pt_expt/train/wrapper.pydeepmd/pt_expt/utils/multi_task.pysource/tests/jax/test_training.py
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5740 +/- ##
==========================================
- Coverage 81.36% 79.53% -1.83%
==========================================
Files 991 1017 +26
Lines 111198 115900 +4702
Branches 4235 4277 +42
==========================================
+ Hits 90474 92183 +1709
- Misses 19199 22173 +2974
- Partials 1525 1544 +19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Tests
Note
Summary by CodeRabbit
shared_dictto reuse descriptor and fitting settings across model branches.shared_dictpreprocessing, link propagation, and correct shared-stat/parameter behavior.