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

[BUG] RuntimeError: inconsistent type map #4034

Closed
Cloudac7 opened this issue Jul 30, 2024 · 1 comment · Fixed by #4031 or #4074
Closed

[BUG] RuntimeError: inconsistent type map #4034

Cloudac7 opened this issue Jul 30, 2024 · 1 comment · Fixed by #4031 or #4074

Comments

@Cloudac7
Copy link
Contributor

Cloudac7 commented Jul 30, 2024

Bug summary

It seems that in 3.0.0b3, executing multitask training or finetune task would run into a RuntimeError, calling inconsistent type map, while the same case could run perfectly on code installed from 2024Q1 branch. The original input.json is uploaded, to identify the bug.

 Traceback (most recent call last):
    File "/public/home/ypliucat/.conda/envs/deepmd-kit-3.0.0b3/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
      return f(*args, **kwargs)
    File "/public/home/ypliucat/.conda/envs/deepmd-kit-3.0.0b3/lib/python3.10/site-packages/deepmd/pt/entrypoints/main.py", line 562, in main
      train(FLAGS)
    File "/public/home/ypliucat/.conda/envs/deepmd-kit-3.0.0b3/lib/python3.10/site-packages/deepmd/pt/entrypoints/main.py", line 311, in train
      train_data = get_data(
    File "/public/home/ypliucat/.conda/envs/deepmd-kit-3.0.0b3/lib/python3.10/site-packages/deepmd/utils/data_system.py", line 802, in get_data
      data = DeepmdDataSystem(
    File "/public/home/ypliucat/.conda/envs/deepmd-kit-3.0.0b3/lib/python3.10/site-packages/deepmd/utils/data_system.py", line 184, in __init__
      self.type_map = self._check_type_map_consistency(type_map_list)
    File "/public/home/ypliucat/.conda/envs/deepmd-kit-3.0.0b3/lib/python3.10/site-packages/deepmd/utils/data_system.py", line 616, in _check_type_map_consistency
      raise RuntimeError(f"inconsistent type map: {ret!s} {ii!s}")
  RuntimeError: inconsistent type map: ['Ag', 'Cu'] ['Ag', 'Ni']

And in #4031, a possible solution to this issue is addressed, but it is not the direct error raised.

DeePMD-kit Version

3.0.0b3

Backend and its version

PyTorch v2.0.0.post200, TensorFlow v2.14.0

How did you download the software?

Offline packages

Input Files, Running Commands, Error Log, etc.

input.json

Steps to Reproduce

Please run a multitask training using dataset from Domains_Cluster.

Further Information, Files, and Links

No response

@njzjz
Copy link
Member

njzjz commented Jul 30, 2024

When the type map is not given (which is a bug) and the data has different type maps, it is expected to raise an error, otherwise we don't know which type map should be used for the model. So #4031 should be the correct way to fix it. However, the error message should be improved. The current one is for developers but not users.

@njzjz njzjz linked a pull request Jul 30, 2024 that will close this issue
@njzjz njzjz added the Docs label Aug 1, 2024
njzjz added a commit to njzjz/deepmd-kit that referenced this issue Aug 21, 2024
Fix deepmodeling#4034.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz linked a pull request Aug 21, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue Aug 22, 2024
Fix #4034.

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

## Summary by CodeRabbit

- **New Features**
- Enhanced error messaging for type map inconsistencies to provide
clearer guidance for users on configuration issues.

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

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz closed this as completed Aug 22, 2024
mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this issue Sep 18, 2024
…4074)

Fix deepmodeling#4034.

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

## Summary by CodeRabbit

- **New Features**
- Enhanced error messaging for type map inconsistencies to provide
clearer guidance for users on configuration issues.

<!-- 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
None yet
2 participants