Skip to content

Commit 659d090

Browse files
authored
Merge branch 'deepmodeling:master' into master
2 parents 63a2902 + c272661 commit 659d090

16 files changed

Lines changed: 390 additions & 20 deletions

File tree

.github/workflows/build_cc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- variant: clang
2828
dp_variant: clang
2929
steps:
30-
- uses: actions/checkout@v6
30+
- uses: actions/checkout@v7
3131
- uses: actions/setup-python@v6
3232
with:
3333
python-version: "3.11"

.github/workflows/build_wheel.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
platform_id: manylinux_aarch64
5252
dp_variant: cpu
5353
steps:
54-
- uses: actions/checkout@v6
54+
- uses: actions/checkout@v7
5555
with:
5656
# https://github.com/pypa/setuptools_scm/issues/480
5757
fetch-depth: 0
@@ -76,7 +76,7 @@ jobs:
7676
name: Build source distribution
7777
runs-on: ubuntu-latest
7878
steps:
79-
- uses: actions/checkout@v6
79+
- uses: actions/checkout@v7
8080
with:
8181
fetch-depth: 0
8282
- name: Build sdist
@@ -123,7 +123,7 @@ jobs:
123123
large-packages: true
124124
swap-storage: true
125125
docker-images: true
126-
- uses: actions/checkout@v6
126+
- uses: actions/checkout@v7
127127
- uses: actions/download-artifact@v8
128128
with:
129129
path: source/install/docker/dist

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v6
33+
uses: actions/checkout@v7
3434
- uses: actions/setup-python@v6
3535
with:
3636
python-version: "3.11"

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# If you do not check out your code, Copilot will do this for you.
3131
steps:
3232
- name: Checkout code
33-
uses: actions/checkout@v6
33+
uses: actions/checkout@v7
3434

3535
- name: Set up Python
3636
uses: actions/setup-python@v6

.github/workflows/package_c.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
large-packages: true
3636
swap-storage: true
3737
docker-images: true
38-
- uses: actions/checkout@v6
38+
- uses: actions/checkout@v7
3939
with:
4040
fetch-depth: 0
4141
- name: Package C library
@@ -63,7 +63,7 @@ jobs:
6363
needs: [build_c]
6464
runs-on: ubuntu-22.04
6565
steps:
66-
- uses: actions/checkout@v6
66+
- uses: actions/checkout@v7
6767
- name: Download artifact
6868
uses: actions/download-artifact@v8
6969
with:

.github/workflows/test_cc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
enable_pytorch: false
3636
enable_paddle: true
3737
steps:
38-
- uses: actions/checkout@v6
38+
- uses: actions/checkout@v7
3939
- uses: actions/setup-python@v6
4040
with:
4141
python-version: "3.11"

.github/workflows/test_cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# options: --gpus all
2424
if: github.repository_owner == 'deepmodeling' && (github.event_name == 'pull_request' && github.event.label && github.event.label.name == 'Test CUDA' || github.event_name == 'workflow_dispatch' || github.event_name == 'merge_group')
2525
steps:
26-
- uses: actions/checkout@v6
26+
- uses: actions/checkout@v7
2727
- uses: actions/setup-python@v6
2828
with:
2929
python-version: "3.11"

.github/workflows/test_python.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
python: ["3.10", "3.13"]
2323

2424
steps:
25-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@v7
2626
- uses: actions/setup-python@v6
2727
with:
2828
python-version: ${{ matrix.python }}
@@ -48,7 +48,7 @@ jobs:
4848
UV_HTTP_TIMEOUT: 120
4949
- run: dp --version
5050
- name: Get durations from cache
51-
uses: actions/cache@v5
51+
uses: actions/cache@v6
5252
with:
5353
path: .test_durations
5454
# the key must never match, even when restarting workflows, as that
@@ -94,7 +94,7 @@ jobs:
9494
needs: testpython
9595
steps:
9696
- name: Get durations from cache
97-
uses: actions/cache@v5
97+
uses: actions/cache@v6
9898
with:
9999
path: .test_durations
100100
# key won't match during the first run for the given commit, but

.github/workflows/todo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
if: github.repository_owner == 'deepmodeling'
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v6
11+
- uses: actions/checkout@v7
1212
- name: Run tdg-github-action
1313
uses: ribtoks/tdg-github-action@master
1414
with:

deepmd/pd/train/training.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
from deepmd.utils.data import (
8282
DataRequirementItem,
8383
)
84+
from deepmd.utils.finetune import (
85+
warn_configuration_mismatch_during_finetune,
86+
)
8487
from deepmd.utils.path import (
8588
DPH5Path,
8689
)
@@ -520,9 +523,8 @@ def get_lr(lr_params: dict[str, Any]) -> BaseLR:
520523
new_state_dict = {}
521524
target_state_dict = self.wrapper.state_dict()
522525
# pretrained_model
523-
pretrained_model = get_model_for_wrapper(
524-
state_dict["_extra_state"]["model_params"]
525-
)
526+
pretrained_model_params = state_dict["_extra_state"]["model_params"]
527+
pretrained_model = get_model_for_wrapper(pretrained_model_params)
526528
pretrained_model_wrapper = ModelWrapper(pretrained_model)
527529
pretrained_model_wrapper.set_state_dict(state_dict)
528530
# update type related params
@@ -557,6 +559,25 @@ def collect_single_finetune_params(
557559
) -> None:
558560
_new_fitting = _finetune_rule_single.get_random_fitting()
559561
_model_key_from = _finetune_rule_single.get_model_branch()
562+
_input_model_params = (
563+
model_params["model_dict"][_model_key]
564+
if self.multi_task
565+
else model_params
566+
)
567+
_pretrained_model_params = (
568+
pretrained_model_params["model_dict"][_model_key_from]
569+
if "model_dict" in pretrained_model_params
570+
else pretrained_model_params
571+
)
572+
if (
573+
"descriptor" in _input_model_params
574+
and "descriptor" in _pretrained_model_params
575+
):
576+
warn_configuration_mismatch_during_finetune(
577+
_input_model_params["descriptor"],
578+
_pretrained_model_params["descriptor"],
579+
_model_key_from,
580+
)
560581
target_keys = [
561582
i
562583
for i in _random_state_dict.keys()

0 commit comments

Comments
 (0)