Skip to content

Commit 2655a95

Browse files
committed
fix
1 parent 6d04442 commit 2655a95

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/workflows/build_cc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
3939
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
4040
&& sudo apt-get update \
41-
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2 libcublas-dev-12-2 libcusparse-dev-12-2
41+
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2 libcublas-dev-12-2 libcusparse-dev-12-2 libcusolver-dev-12-2
4242
if: matrix.variant == 'cuda120'
4343
env:
4444
DEBIAN_FRONTEND: noninteractive

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
4343
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
4444
&& sudo apt-get update \
45-
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2 libcublas-dev-12-2 libcusparse-dev-12-2
45+
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2 libcublas-dev-12-2 libcusparse-dev-12-2 libcusolver-dev-12-2
4646
python -m pip install uv
4747
uv pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
4848
env:

deepmd/kernels/cuda/dpa1/graph_energy_force.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,13 @@ def _cpu(
245245
protection,
246246
nnei,
247247
)
248+
# Assemble force / virial in the descriptor weight precision, matching
249+
# ``_fake`` and the CUDA operator; the sub-operator would otherwise return
250+
# fp64 whenever the edge inputs are fp64.
251+
fprec = w1.dtype
248252
force, atom_virial, virial = torch.ops.deepmd.edge_force_virial(
249-
g_e,
250-
edge_vec,
253+
g_e.to(fprec),
254+
edge_vec.to(fprec),
251255
edge_index,
252256
edge_mask,
253257
n_node,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ environment-pass = [
305305
]
306306
before-all = [
307307
"""if [ ! -z "${DP_PKG_NAME}" ]; then sed -i "s/name = \\"deepmd-kit\\"/name = \\"${DP_PKG_NAME}\\"/g" pyproject.toml; fi""",
308-
"""{ if [ -n "${CUDA_VERSION}" ] && [ "$(uname -m)" = "x86_64" ] ; then yum config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo && yum install -y cuda-nvcc-${CUDA_VERSION/./-} cuda-cudart-devel-${CUDA_VERSION/./-} libcublas-devel-${CUDA_VERSION/./-} libcusparse-devel-${CUDA_VERSION/./-}; fi }""",
308+
"""{ if [ -n "${CUDA_VERSION}" ] && [ "$(uname -m)" = "x86_64" ] ; then yum config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo && yum install -y cuda-nvcc-${CUDA_VERSION/./-} cuda-cudart-devel-${CUDA_VERSION/./-} libcublas-devel-${CUDA_VERSION/./-} libcusparse-devel-${CUDA_VERSION/./-} libcusolver-devel-${CUDA_VERSION/./-}; fi }""",
309309
]
310310
before-build = [
311311
]

source/install/docker_package_c.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ PYTORCH_DEPENDENCY_GROUP=${PYTORCH_DEPENDENCY_GROUP:-pin_pytorch_cpu}
77
PYTORCH_TORCH_BACKEND=${PYTORCH_TORCH_BACKEND:-cpu}
88
TENSORFLOW_DEPENDENCY_GROUP=${TENSORFLOW_DEPENDENCY_GROUP:-pin_tensorflow_cpu}
99
# CUDA version tag (e.g. "12-9") parsed from the manylinux CUDA image name. It
10-
# selects the cuBLAS/cuSPARSE development packages installed inside the
11-
# container: the fused PyTorch CUDA operators pull in ATen CUDA headers that
12-
# require cublas and cusparse headers absent from the base image.
10+
# selects the cuBLAS/cuSPARSE/cuSOLVER development packages installed inside the
11+
# container: the fused PyTorch CUDA operators pull in ATen CUDA headers
12+
# (CUDAContextLight.h) that include cublas_v2.h, cusparse.h and cusolverDn.h,
13+
# none of which ship in the base image.
1314
CUDA_VERSION_DASH=$(printf '%s' "${MANYLINUX_CUDA_IMAGE}" | sed -n 's/.*cuda\([0-9][0-9]*\)_\([0-9][0-9]*\).*/\1-\2/p')
1415

1516
docker run --rm -v "${SCRIPT_PATH}/../..":/root/deepmd-kit -w /root/deepmd-kit \
@@ -27,8 +28,8 @@ docker run --rm -v "${SCRIPT_PATH}/../..":/root/deepmd-kit -w /root/deepmd-kit \
2728
"${MANYLINUX_CUDA_IMAGE}" \
2829
/bin/bash -lc 'set -euo pipefail
2930
if [ -n "${CUDA_VERSION_DASH:-}" ]; then
30-
yum config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
31-
yum install -y "libcublas-devel-${CUDA_VERSION_DASH}" "libcusparse-devel-${CUDA_VERSION_DASH}"
31+
yum config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
32+
yum install -y "libcublas-devel-${CUDA_VERSION_DASH}" "libcusparse-devel-${CUDA_VERSION_DASH}" "libcusolver-devel-${CUDA_VERSION_DASH}"
3233
fi
3334
export PATH="$(dirname "${PYTHON_BIN}"):${PATH}"
3435
"${PYTHON_BIN}" -m pip install uv

0 commit comments

Comments
 (0)