Skip to content

Commit

Permalink
Fix: Atomic stat with multi-system (#4370)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
	- Enhanced model prediction process with improved batch handling.
- Restructured output data processing for better compatibility during
concatenation.
	- Added new test data files for water tensor dipole simulations.

- **Bug Fixes**
- Improved error handling for file existence checks and bias restoration
in statistics computation.

- **Documentation**
	- Updated function signatures to reflect internal logic modifications.
- Expanded training data systems in configuration for water tensor
training.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
anyangml and pre-commit-ci[bot] authored Nov 19, 2024
1 parent 25b2abf commit db2bc94
Show file tree
Hide file tree
Showing 16 changed files with 540 additions and 2 deletions.
12 changes: 11 additions & 1 deletion deepmd/pt/utils/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,17 @@ def compute_output_stats_atomic(
]
for kk in keys
}
# shape: (nframes, nloc, ndim)
# reshape outputs [nframes, nloc * ndim] --> reshape to [nframes * nloc, 1, ndim] for concatenation
# reshape natoms [nframes, nloc] --> reshape to [nframes * nolc, 1] for concatenation
natoms = {k: [sys_v.reshape(-1, 1) for sys_v in v] for k, v in natoms.items()}
outputs = {
k: [
sys.reshape(natoms[k][sys_idx].shape[0], 1, -1)
for sys_idx, sys in enumerate(v)
]
for k, v in outputs.items()
}

merged_output = {
kk: to_numpy_array(torch.cat(outputs[kk]))
for kk in keys
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
234 changes: 234 additions & 0 deletions source/tests/pt/water_tensor/dipole/O78H156/type.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
2 changes: 2 additions & 0 deletions source/tests/pt/water_tensor/dipole/O78H156/type_map.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
O
H
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit db2bc94

Please sign in to comment.