Skip to content

Commit

Permalink
fix bugs and enable more pd unitests
Browse files Browse the repository at this point in the history
  • Loading branch information
HydrogenSulfate committed Nov 1, 2024
1 parent 26047e9 commit d03702a
Show file tree
Hide file tree
Showing 10 changed files with 158 additions and 254 deletions.
365 changes: 135 additions & 230 deletions deepmd/pd/infer/deep_eval.py

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions deepmd/pd/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
set_default_nthreads,
)

log = logging.getLogger(__name__)

SAMPLER_RECORD = os.environ.get("SAMPLER_RECORD", False)
try:
# only linux
Expand Down Expand Up @@ -87,6 +85,7 @@ def enable_prim(enable: bool = True):

core.set_prim_eager_enabled(True)
core._set_prim_all_enabled(True)
log = logging.getLogger(__name__)
log.info("Enable prim in eager and static mode.")


Expand Down
6 changes: 3 additions & 3 deletions source/tests/pd/model/test_forward_lower.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import numpy as np
import paddle

from deepmd.pd.infer.deep_eval import (
eval_model,
)
from deepmd.pd.model.model import (
get_model,
)
Expand All @@ -22,6 +19,9 @@
from ...seed import (
GLOBAL_SEED,
)
from ..common import (
eval_model,
)
from .test_permutation import ( # model_dpau,
model_dpa1,
model_dpa2,
Expand Down
2 changes: 1 addition & 1 deletion source/tests/pd/model/test_make_hessian_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def ff(xx):
)


@unittest.skip("TODO")
@unittest.skip("Skip temporarily")
class TestDPModel(unittest.TestCase, HessianTest):
def setUp(self):
paddle.seed(2)
Expand Down
6 changes: 3 additions & 3 deletions source/tests/pd/model/test_permutation_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import numpy as np
import paddle

from deepmd.pd.infer.deep_eval import (
eval_model,
)
from deepmd.pd.model.model import (
get_model,
)
Expand All @@ -18,6 +15,9 @@
from ...seed import (
GLOBAL_SEED,
)
from ..common import (
eval_model,
)
from .test_permutation import ( # model_dpau,
model_dpa1,
model_dpa2,
Expand Down
6 changes: 3 additions & 3 deletions source/tests/pd/model/test_rot_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import numpy as np
import paddle

from deepmd.pd.infer.deep_eval import (
eval_model,
)
from deepmd.pd.model.model import (
get_model,
)
Expand All @@ -18,6 +15,9 @@
from ...seed import (
GLOBAL_SEED,
)
from ..common import (
eval_model,
)
from .test_permutation_denoise import (
model_dpa1,
model_dpa2,
Expand Down
6 changes: 3 additions & 3 deletions source/tests/pd/model/test_smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import numpy as np
import paddle

from deepmd.pd.infer.deep_eval import (
eval_model,
)
from deepmd.pd.model.model import (
get_model,
)
Expand All @@ -18,6 +15,9 @@
from ...seed import (
GLOBAL_SEED,
)
from ..common import (
eval_model,
)
from .test_permutation import ( # model_dpau,
model_dos,
model_dpa1,
Expand Down
6 changes: 3 additions & 3 deletions source/tests/pd/model/test_smooth_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import numpy as np
import paddle

from deepmd.pd.infer.deep_eval import (
eval_model,
)
from deepmd.pd.model.model import (
get_model,
)
Expand All @@ -18,6 +15,9 @@
from ...seed import (
GLOBAL_SEED,
)
from ..common import (
eval_model,
)
from .test_permutation_denoise import (
model_dpa2,
)
Expand Down
6 changes: 3 additions & 3 deletions source/tests/pd/model/test_trans_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import numpy as np
import paddle

from deepmd.pd.infer.deep_eval import (
eval_model,
)
from deepmd.pd.model.model import (
get_model,
)
Expand All @@ -18,6 +15,9 @@
from ...seed import (
GLOBAL_SEED,
)
from ..common import (
eval_model,
)
from .test_permutation_denoise import (
model_dpa1,
model_dpa2,
Expand Down
6 changes: 3 additions & 3 deletions source/tests/pd/model/test_unused_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

import paddle

from deepmd.pd.infer.deep_eval import (
eval_model,
)
from deepmd.pd.model.model import (
get_model,
)
Expand All @@ -17,6 +14,9 @@
from ...seed import (
GLOBAL_SEED,
)
from ..common import (
eval_model,
)
from .test_permutation import (
model_dpa2,
)
Expand Down

0 comments on commit d03702a

Please sign in to comment.