Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ build:
post_create_environment:
- pip install uv
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -r doc/requirements.txt
# RTD renders documentation without executing custom PyTorch operators.
- DP_ENABLE_PYTORCH=0 VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -r doc/requirements.txt
apt_packages:
- inkscape
sphinx:
Expand Down
5 changes: 4 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ if(ENABLE_PYTORCH AND NOT DEEPMD_C_ROOT)
else()
set(DEEPMD_TORCH_HAS_CUDA FALSE)
endif()
if(NOT Torch_VERSION VERSION_LESS "2.1.0")
# PyTorch 2.14 raised the minimum C++ standard from C++17 to C++20.
if(NOT Torch_VERSION VERSION_LESS "2.14.0")
set_if_higher(CMAKE_CXX_STANDARD 20)
Comment thread
iProzd marked this conversation as resolved.
elseif(NOT Torch_VERSION VERSION_LESS "2.1.0")
set_if_higher(CMAKE_CXX_STANDARD 17)
elseif(NOT Torch_VERSION VERSION_LESS "1.5.0")
set_if_higher(CMAKE_CXX_STANDARD 14)
Expand Down
3 changes: 2 additions & 1 deletion source/lmp/tests/dpa4_spin_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def compute_expected(
proc = sp.run([sys.executable, "-c", script], capture_output=True, text=True)
if proc.returncode != 0:
raise RuntimeError(f"Failed to compute expected values:\n{proc.stderr}")
result = json.loads(proc.stdout.strip())
# Warp and other backends may log to stdout before the final JSON payload.
result = json.loads(proc.stdout.strip().splitlines()[-1])

# Raw DeepEval force_mag (dE/dspin), scaled by LAMMPS's own
# spin_norm / hbar unit convention (see HBAR_METAL) before comparison.
Expand Down
3 changes: 2 additions & 1 deletion source/lmp/tests/test_lammps_dpa4_chg_spin_deepspin_pt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def _compute_expected() -> None:
proc = sp.run([sys.executable, "-c", script], capture_output=True, text=True)
if proc.returncode != 0:
raise RuntimeError(f"Failed to compute expected values:\n{proc.stderr}")
result = json.loads(proc.stdout.strip())
# Warp and other backends may log to stdout before the final JSON payload.
result = json.loads(proc.stdout.strip().splitlines()[-1])

# Raw DeepEval force_mag (dE/dspin), scaled by LAMMPS's own
# spin_norm / hbar unit convention (see ``_HBAR_METAL`` above) before
Expand Down
3 changes: 2 additions & 1 deletion source/lmp/tests/test_lammps_dpa4_zbl_pt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def _compute_expected() -> None:
proc = sp.run([sys.executable, "-c", script], capture_output=True, text=True)
if proc.returncode != 0:
raise RuntimeError(f"Failed to compute expected values:\n{proc.stderr}")
result = json.loads(proc.stdout.strip())
# Warp and other backends may log to stdout before the final JSON payload.
result = json.loads(proc.stdout.strip().splitlines()[-1])

expected_e = result["e"]
expected_ae = np.array(result["ae"])
Expand Down
15 changes: 12 additions & 3 deletions source/op/pt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,18 @@ if(USE_CUDA_TOOLKIT AND DEEPMD_TORCH_HAS_CUDA)
${DEEPMD_PT_CUDA_ARCHITECTURES})
endif()
target_link_libraries(deepmd_op_pt PRIVATE CUDA::cublas CUDA::cublasLt)
# libtorch headers require C++17; the CUDA sources must match.
set_target_properties(deepmd_op_pt PROPERTIES CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON)
# libtorch headers require at least C++17, and PyTorch 2.14+ requires C++20.
# Preserve an explicitly higher CUDA standard requested by the user.
set(DEEPMD_PT_CUDA_STANDARD 17)
if(NOT Torch_VERSION VERSION_LESS "2.14.0")
set_if_higher(DEEPMD_PT_CUDA_STANDARD 20)
endif()
if(CMAKE_CUDA_STANDARD)
set_if_higher(DEEPMD_PT_CUDA_STANDARD ${CMAKE_CUDA_STANDARD})
endif()
set_target_properties(
deepmd_op_pt PROPERTIES CUDA_STANDARD ${DEEPMD_PT_CUDA_STANDARD}
CUDA_STANDARD_REQUIRED ON)
if(DEEPMD_ENABLE_DPA1_HIGH_LMAX)
target_compile_definitions(deepmd_op_pt
PRIVATE DEEPMD_ENABLE_DPA1_HIGH_LMAX=1)
Expand Down
Loading