-
Notifications
You must be signed in to change notification settings - Fork 608
feat(pt_expt): multi-task training support #5397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wanghan-iapcm
wants to merge
15
commits into
deepmodeling:master
Choose a base branch
from
wanghan-iapcm:feat-pt-expt-multi-task
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
512eeb6
feat(pt_expt): multi-task training support
9f4d232
fix(dpmodel): wrap fparam/aparam reshape with descriptive ValueError
9f1f1d8
fix: address CodeQL findings in PR #5397
f3f5474
fix(pt_expt): access unwrapped module in _compile_model for DDP compat
665b85a
test(pt_expt): add DDP + torch.compile training tests
aabb710
feat(pt_expt): use inductor+dynamic for training compile
f774cd2
test(pt_expt): port silut activation + repformers accessors from #5393
0b5468e
test(pt_expt): assert virial in compile correctness tests
9bf006b
test(pt_expt): port silu compile and varying-natoms tests from #5393
7722f52
test(pt_expt): compare compiled vs uncompiled with varying natoms
be14ac2
test(pt_expt): cover DPA2/DPA3 in varying-natoms compile correctness
4c0b8ec
test(pt_expt): exercise DPA2 three-body branch in compile correctness
80c714c
fix(dpmodel): restore nf in reshapes to fix zero-atom and add silu_ba…
6158d9c
fix: address CodeQL findings in PR #5397
c2efbf1
fix(pt): wrap fparam/aparam reshape with descriptive ValueError
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -779,10 +779,10 @@ def _forward_common( | |
| assert fparam is not None, "fparam should not be None" | ||
| assert self.fparam_avg is not None | ||
| assert self.fparam_inv_std is not None | ||
| if fparam.shape[-1] != self.numb_fparam: | ||
| if fparam.numel() != nf * self.numb_fparam: | ||
| raise ValueError( | ||
| "get an input fparam of dim {fparam.shape[-1]}, ", | ||
| "which is not consistent with {self.numb_fparam}.", | ||
| f"input fparam: cannot reshape {list(fparam.shape)} " | ||
| f"into ({nf}, {self.numb_fparam})." | ||
| ) | ||
| fparam = fparam.view([nf, self.numb_fparam]) | ||
| nb, _ = fparam.shape | ||
|
|
@@ -804,10 +804,10 @@ def _forward_common( | |
| assert aparam is not None, "aparam should not be None" | ||
| assert self.aparam_avg is not None | ||
| assert self.aparam_inv_std is not None | ||
| if aparam.shape[-1] != self.numb_aparam: | ||
| if aparam.numel() % (nf * self.numb_aparam) != 0: | ||
| raise ValueError( | ||
| f"get an input aparam of dim {aparam.shape[-1]}, ", | ||
| f"which is not consistent with {self.numb_aparam}.", | ||
| f"input aparam: cannot reshape {list(aparam.shape)} " | ||
| f"into ({nf}, nloc, {self.numb_aparam})." | ||
| ) | ||
| aparam = aparam.view([nf, -1, self.numb_aparam]) | ||
| nb, nloc, _ = aparam.shape | ||
|
Comment on lines
779
to
813
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. The removed checks were buggy (non-f-string + tuple |
||
|
|
||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was valid at the time of review — the code previously used
(-1, self.numb_fparam). Fixed in 80c714c which changed the reshape to(nf, self.numb_fparam), now matching the error message.