Skip to content
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

dpa2 model may need a fake communication op to deal with nloc == 0. #3732

Closed
github-actions bot opened this issue Apr 30, 2024 · 3 comments · Fixed by #4021
Closed

dpa2 model may need a fake communication op to deal with nloc == 0. #3732

github-actions bot opened this issue Apr 30, 2024 · 3 comments · Fixed by #4021

Comments

@github-actions
Copy link

this should be fixed after wrapping comm op as a pure c++ implementation.

Line: 135

nghost, ntypes, 1, daparam, nall, aparam_nall);
int nloc = nall_real - nghost_real;
int nframes = 1;
// TODO: dpa2 model may need a fake communication op to deal with nloc == 0.
// this should be fixed after wrapping comm op as a pure c++ implementation.
if (nloc == 0) {
// no backward map needed
ener.resize(nframes);
// dforce of size nall * 3
force.resize(static_cast<size_t>(nframes) * fwd_map.size() * 3);
fill(force.begin(), force.end(), (VALUETYPE)0.0);

@njzjz
Copy link
Member

njzjz commented Jun 6, 2024

It seems to me that we should support the situation for nloc == 0 everywhere, instead of writing a special case.

@wanghan-iapcm
Copy link
Collaborator

I agree.

@njzjz njzjz assigned cherryWangY and unassigned CaRoLZhangxy Jun 29, 2024
@njzjz njzjz assigned njzjz and unassigned cherryWangY Jul 24, 2024
@njzjz njzjz added the bug label Jul 25, 2024
@njzjz njzjz linked a pull request Jul 25, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue Jul 26, 2024
Fix #3732. Removes the special codes for `nloc==0` which has been
supported by #4005.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
	- Improved robustness in tensor handling when inputs are empty.
- Enhanced test coverage for parameters in the `test_pair_deepmd_si` and
`test_pair_deepmd_mpi` functions, testing scenarios with and without
balance arguments.
- **Bug Fixes**
- Adjusted control flow in the `compute` method to simplify handling of
zero atoms or local atoms.


<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Copy link
Author

Closed in commit 7907142

mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this issue Sep 18, 2024
Fix deepmodeling#3732. Removes the special codes for `nloc==0` which has been
supported by deepmodeling#4005.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
	- Improved robustness in tensor handling when inputs are empty.
- Enhanced test coverage for parameters in the `test_pair_deepmd_si` and
`test_pair_deepmd_mpi` functions, testing scenarios with and without
balance arguments.
- **Bug Fixes**
- Adjusted control flow in the `compute` method to simplify handling of
zero atoms or local atoms.


<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

4 participants