Skip to content

Commit

Permalink
Merge branch 'devel' into enerhess
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyking authored Dec 25, 2024
2 parents 550178e + 30b1447 commit 8c1656a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
exclude: ^source/3rdparty
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.3
rev: v0.8.4
hooks:
- id: ruff
args: ["--fix"]
Expand Down
1 change: 1 addition & 0 deletions deepmd/pd/infer/deep_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def __init__(
else:
# self.dp = paddle.jit.load(self.model_path.split(".json")[0])
raise ValueError(f"Unknown model file format: {self.model_path}!")
self.dp.eval()
self.rcut = self.dp.model["Default"].get_rcut()
self.type_map = self.dp.model["Default"].get_type_map()
if isinstance(auto_batch_size, bool):
Expand Down
8 changes: 2 additions & 6 deletions deepmd/pd/utils/auto_batch_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ def is_oom_error(self, e: Exception) -> bool:
# several sources think CUSOLVER_STATUS_INTERNAL_ERROR is another out-of-memory error,
# such as https://github.com/JuliaGPU/CUDA.jl/issues/1924
# (the meaningless error message should be considered as a bug in cusolver)
if isinstance(e, RuntimeError) and (
"CUDA out of memory." in e.args[0]
or "CUDA driver error: out of memory" in e.args[0]
or "cusolver error: CUSOLVER_STATUS_INTERNAL_ERROR" in e.args[0]
):
if isinstance(e, MemoryError) and ("ResourceExhaustedError" in e.args[0]):
# Release all unoccupied cached memory
# paddle.device.cuda.empty_cache()
paddle.device.cuda.empty_cache()
return True
return False
2 changes: 1 addition & 1 deletion deepmd/pd/utils/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ def normalize_coord(
"""
icoord = phys2inter(coord, cell)
icoord = paddle.remainder(icoord, paddle.full([], 1.0))
icoord = paddle.remainder(icoord, paddle.full([], 1.0, dtype=icoord.dtype))
return inter2phys(icoord, cell)

0 comments on commit 8c1656a

Please sign in to comment.