From 9e8b9f0e9e7da534a3314d14df63960eccf82b01 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Mon, 14 Sep 2026 22:49:02 +0800 Subject: [PATCH 1/8] ci: cache C++ compilation with ccache Agent: ChatGPT Model: GPT-5.6 Sol --- .github/workflows/build_cc.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 71db83fff9..5d698e1598 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -15,6 +15,9 @@ jobs: buildcc: name: Build C++ runs-on: ubuntu-22.04 + env: + CCACHE_BASEDIR: ${{ github.workspace }} + CCACHE_COMPILERCHECK: content strategy: matrix: include: @@ -49,12 +52,21 @@ jobs: && sudo apt-get update \ && sudo apt-get install -y rocm-dev hipcub-dev if: matrix.variant == 'rocm' + - name: Set up ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: build-cc-${{ matrix.variant }} + max-size: 1G - run: | source/install/build_cc.sh env: DP_VARIANT: ${{ matrix.dp_variant }} DOWNLOAD_TENSORFLOW: "FALSE" CMAKE_GENERATOR: Ninja + CMAKE_C_COMPILER_LAUNCHER: ccache + CMAKE_CXX_COMPILER_LAUNCHER: ccache + CMAKE_CUDA_COMPILER_LAUNCHER: ccache + CMAKE_HIP_COMPILER_LAUNCHER: ccache if: matrix.variant != 'clang' - run: | source/install/build_cc.sh @@ -64,7 +76,12 @@ jobs: CC: clang CXX: clang++ CMAKE_GENERATOR: Ninja + CMAKE_C_COMPILER_LAUNCHER: ccache + CMAKE_CXX_COMPILER_LAUNCHER: ccache if: matrix.variant == 'clang' + - name: Show ccache statistics + if: always() + run: ccache --show-stats - name: Test files exist run: | test -f dp/bin/dp_ipi && From 1081a404437f60135376dcd7ae95022f03c23817 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Tue, 15 Sep 2026 11:52:10 +0800 Subject: [PATCH 2/8] ci: avoid apt overhead for ccache setup Agent: ChatGPT Model: GPT-5.6 Sol --- .github/workflows/build_cc.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 5d698e1598..24aba2aba9 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -16,8 +16,11 @@ jobs: name: Build C++ runs-on: ubuntu-22.04 env: + CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_BASEDIR: ${{ github.workspace }} CCACHE_COMPILERCHECK: content + CCACHE_MAXSIZE: 1G + CCACHE_COMPRESS: "true" strategy: matrix: include: @@ -52,11 +55,28 @@ jobs: && sudo apt-get update \ && sudo apt-get install -y rocm-dev hipcub-dev if: matrix.variant == 'rocm' - - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1.2 + - name: Install ccache + shell: bash + run: | + CCACHE_VERSION=4.14 + CCACHE_ARCHIVE="ccache-${CCACHE_VERSION}-linux-x86_64-musl-static.tar.xz" + curl -L --fail --retry 3 \ + "https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/${CCACHE_ARCHIVE}" \ + -o "$RUNNER_TEMP/$CCACHE_ARCHIVE" + echo "888eaf9697919d6eba77be797e9d9c9e40e734d11d67d25a79b075c3f79f6c77 $RUNNER_TEMP/$CCACHE_ARCHIVE" | sha256sum -c - + tar -xJf "$RUNNER_TEMP/$CCACHE_ARCHIVE" -C "$RUNNER_TEMP" + echo "$RUNNER_TEMP/ccache-${CCACHE_VERSION}-linux-x86_64-musl-static" >> "$GITHUB_PATH" + - name: Restore ccache + uses: actions/cache@v4 with: - key: build-cc-${{ matrix.variant }} - max-size: 1G + path: ${{ github.workspace }}/.ccache + key: ccache-build-cc-${{ matrix.variant }}-v4.14-${{ github.run_id }} + restore-keys: | + ccache-build-cc-${{ matrix.variant }}- + - name: Reset ccache statistics + run: | + ccache --version + ccache --zero-stats - run: | source/install/build_cc.sh env: From 6eee627047162056b4f8d1fc78232420617dcc79 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Tue, 15 Sep 2026 16:43:50 +0800 Subject: [PATCH 3/8] ci: cache LAMMPS source for C++ builds Agent: ChatGPT Model: GPT-5.6 Sol --- .github/workflows/build_cc.yml | 25 +++++++++++++++++++++---- source/install/build_cc.sh | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 24aba2aba9..16e12159a1 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -21,6 +21,9 @@ jobs: CCACHE_COMPILERCHECK: content CCACHE_MAXSIZE: 1G CCACHE_COMPRESS: "true" + CCACHE_VERSION: "4.14" + LAMMPS_VERSION: stable_22Jul2025_update2 + LAMMPS_SOURCE_DIR: ${{ github.workspace }}/.cache/lammps/stable_22Jul2025_update2 strategy: matrix: include: @@ -55,10 +58,22 @@ jobs: && sudo apt-get update \ && sudo apt-get install -y rocm-dev hipcub-dev if: matrix.variant == 'rocm' + - name: Restore LAMMPS source + id: lammps-cache + uses: actions/cache@v4 + with: + path: ${{ env.LAMMPS_SOURCE_DIR }} + key: lammps-source-${{ env.LAMMPS_VERSION }}-v1 + - name: Fetch LAMMPS source + if: steps.lammps-cache.outputs.cache-hit != 'true' + shell: bash + run: | + rm -rf "$LAMMPS_SOURCE_DIR" + git clone --depth 1 --branch "$LAMMPS_VERSION" \ + https://github.com/lammps/lammps "$LAMMPS_SOURCE_DIR" - name: Install ccache shell: bash run: | - CCACHE_VERSION=4.14 CCACHE_ARCHIVE="ccache-${CCACHE_VERSION}-linux-x86_64-musl-static.tar.xz" curl -L --fail --retry 3 \ "https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/${CCACHE_ARCHIVE}" \ @@ -69,10 +84,10 @@ jobs: - name: Restore ccache uses: actions/cache@v4 with: - path: ${{ github.workspace }}/.ccache - key: ccache-build-cc-${{ matrix.variant }}-v4.14-${{ github.run_id }} + path: ${{ env.CCACHE_DIR }} + key: ccache-build-cc-${{ matrix.variant }}-v${{ env.CCACHE_VERSION }}-${{ github.run_id }}-${{ github.run_attempt }} restore-keys: | - ccache-build-cc-${{ matrix.variant }}- + ccache-build-cc-${{ matrix.variant }}-v${{ env.CCACHE_VERSION }}- - name: Reset ccache statistics run: | ccache --version @@ -83,6 +98,7 @@ jobs: DP_VARIANT: ${{ matrix.dp_variant }} DOWNLOAD_TENSORFLOW: "FALSE" CMAKE_GENERATOR: Ninja + CMAKE_ARGS: -DFETCHCONTENT_SOURCE_DIR_LAMMPS_DOWNLOAD=${{ env.LAMMPS_SOURCE_DIR }} CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache CMAKE_CUDA_COMPILER_LAUNCHER: ccache @@ -96,6 +112,7 @@ jobs: CC: clang CXX: clang++ CMAKE_GENERATOR: Ninja + CMAKE_ARGS: -DFETCHCONTENT_SOURCE_DIR_LAMMPS_DOWNLOAD=${{ env.LAMMPS_SOURCE_DIR }} CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache if: matrix.variant == 'clang' diff --git a/source/install/build_cc.sh b/source/install/build_cc.sh index 56c50e92f5..8c2bc879ec 100755 --- a/source/install/build_cc.sh +++ b/source/install/build_cc.sh @@ -27,6 +27,7 @@ cmake -D ENABLE_TENSORFLOW=ON \ -D USE_PT_PYTHON_LIBS=TRUE \ ${CUDA_ARGS} \ -D LAMMPS_VERSION=stable_22Jul2025_update2 \ + ${CMAKE_ARGS:-} \ .. cmake --build . -j${NPROC} cmake --install . From 01054bb9a6b70a880bee45536bdbdded26720081 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Tue, 15 Sep 2026 16:46:56 +0800 Subject: [PATCH 4/8] ci: use cached LAMMPS source directly Agent: ChatGPT Model: GPT-5.6 Sol --- .github/workflows/build_cc.yml | 4 ++-- source/install/build_cc.sh | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 16e12159a1..cbe62268a6 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -98,7 +98,7 @@ jobs: DP_VARIANT: ${{ matrix.dp_variant }} DOWNLOAD_TENSORFLOW: "FALSE" CMAKE_GENERATOR: Ninja - CMAKE_ARGS: -DFETCHCONTENT_SOURCE_DIR_LAMMPS_DOWNLOAD=${{ env.LAMMPS_SOURCE_DIR }} + LAMMPS_SOURCE_ROOT: ${{ env.LAMMPS_SOURCE_DIR }} CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache CMAKE_CUDA_COMPILER_LAUNCHER: ccache @@ -112,7 +112,7 @@ jobs: CC: clang CXX: clang++ CMAKE_GENERATOR: Ninja - CMAKE_ARGS: -DFETCHCONTENT_SOURCE_DIR_LAMMPS_DOWNLOAD=${{ env.LAMMPS_SOURCE_DIR }} + LAMMPS_SOURCE_ROOT: ${{ env.LAMMPS_SOURCE_DIR }} CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache if: matrix.variant == 'clang' diff --git a/source/install/build_cc.sh b/source/install/build_cc.sh index 8c2bc879ec..3cd499d137 100755 --- a/source/install/build_cc.sh +++ b/source/install/build_cc.sh @@ -5,6 +5,11 @@ if [ "$DP_VARIANT" = "cuda" ]; then elif [ "$DP_VARIANT" = "rocm" ]; then CUDA_ARGS="-DUSE_ROCM_TOOLKIT=TRUE" fi +if [ -n "${LAMMPS_SOURCE_ROOT:-}" ]; then + LAMMPS_ARGS="-D LAMMPS_SOURCE_ROOT=${LAMMPS_SOURCE_ROOT}" +else + LAMMPS_ARGS="-D LAMMPS_VERSION=stable_22Jul2025_update2" +fi #------------------ SCRIPT_PATH=$(dirname $(realpath -s $0)) @@ -26,7 +31,7 @@ cmake -D ENABLE_TENSORFLOW=ON \ -D USE_TF_PYTHON_LIBS=TRUE \ -D USE_PT_PYTHON_LIBS=TRUE \ ${CUDA_ARGS} \ - -D LAMMPS_VERSION=stable_22Jul2025_update2 \ + ${LAMMPS_ARGS} \ ${CMAKE_ARGS:-} \ .. cmake --build . -j${NPROC} From 4e26550af52bf2ff0cbf2c5bd5e568739c1aaf11 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Mon, 26 Oct 2026 23:54:17 +0800 Subject: [PATCH 5/8] ci: disable PCH for ccache-enabled C++ builds Pass -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON in both the standard and clang Build C++ paths. Preserve normal build_cc.sh behavior when not using this ccache CI workflow. Agent: ChatGPT Model: GPT-6 --- .github/workflows/build_cc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index cbe62268a6..c3c381d03d 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -98,6 +98,7 @@ jobs: DP_VARIANT: ${{ matrix.dp_variant }} DOWNLOAD_TENSORFLOW: "FALSE" CMAKE_GENERATOR: Ninja + CMAKE_ARGS: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON" LAMMPS_SOURCE_ROOT: ${{ env.LAMMPS_SOURCE_DIR }} CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache @@ -112,6 +113,7 @@ jobs: CC: clang CXX: clang++ CMAKE_GENERATOR: Ninja + CMAKE_ARGS: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON" LAMMPS_SOURCE_ROOT: ${{ env.LAMMPS_SOURCE_DIR }} CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache From dd96b6d938cff7acbd86127805767ee070fe3bd3 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Wed, 28 Oct 2026 12:48:00 +0800 Subject: [PATCH 6/8] fix(ci): include GPU device headers without PCH and pin cache action Make DataModifierTF and DeepTensorTF explicitly include device.h so CUDA and ROCm builds no longer rely on transitive precompiled headers. Pin both new actions/cache steps to the verified v4.3.0 commit. Agent: ChatGPT Model: GPT-6 --- .github/workflows/build_cc.yml | 4 ++-- source/api_cc/src/DataModifierTF.cc | 1 + source/api_cc/src/DeepTensorTF.cc | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index c3c381d03d..ba9f581dca 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -60,7 +60,7 @@ jobs: if: matrix.variant == 'rocm' - name: Restore LAMMPS source id: lammps-cache - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ env.LAMMPS_SOURCE_DIR }} key: lammps-source-${{ env.LAMMPS_VERSION }}-v1 @@ -82,7 +82,7 @@ jobs: tar -xJf "$RUNNER_TEMP/$CCACHE_ARCHIVE" -C "$RUNNER_TEMP" echo "$RUNNER_TEMP/ccache-${CCACHE_VERSION}-linux-x86_64-musl-static" >> "$GITHUB_PATH" - name: Restore ccache - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ env.CCACHE_DIR }} key: ccache-build-cc-${{ matrix.variant }}-v${{ env.CCACHE_VERSION }}-${{ github.run_id }}-${{ github.run_attempt }} diff --git a/source/api_cc/src/DataModifierTF.cc b/source/api_cc/src/DataModifierTF.cc index bce80f9606..d35f365ef4 100644 --- a/source/api_cc/src/DataModifierTF.cc +++ b/source/api_cc/src/DataModifierTF.cc @@ -3,6 +3,7 @@ #include "DataModifierTF.h" #include "common.h" +#include "device.h" using namespace deepmd; using namespace tensorflow; diff --git a/source/api_cc/src/DeepTensorTF.cc b/source/api_cc/src/DeepTensorTF.cc index 12bfc15eaf..bc7c191974 100644 --- a/source/api_cc/src/DeepTensorTF.cc +++ b/source/api_cc/src/DeepTensorTF.cc @@ -2,6 +2,8 @@ #ifdef BUILD_TENSORFLOW #include "DeepTensorTF.h" +#include "device.h" + using namespace deepmd; using namespace tensorflow; From 9b6a5b0e2790be5f2cd6fe01bf582c0b1990ca93 Mon Sep 17 00:00:00 2001 From: njzjz-bot Date: Wed, 28 Oct 2026 18:30:04 +0800 Subject: [PATCH 7/8] fix(docs): bound external inventory requests Coding-Agent: Codex Codex-Version: codex-cli 0.164.0 Model: gpt-6-astra Reasoning-Effort: xhigh --- doc/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 5753b2afed..c9feba1251 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -142,6 +142,10 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +# External inventories are optional cross-reference metadata. A stalled host +# must not consume the entire Read the Docs build budget; Sphinx can continue +# with its other inventories after reporting the failed request. +intersphinx_timeout = 30 intersphinx_mapping = { "numpy": ("https://docs.scipy.org/doc/numpy/", None), "python": ("https://docs.python.org/", None), From 1cca0917e1d1e5b936273d8cbbbf8565f187747b Mon Sep 17 00:00:00 2001 From: njzjz-bot Date: Wed, 28 Oct 2026 19:39:34 +0800 Subject: [PATCH 8/8] docs: clarify intersphinx timeout scope Coding-Agent: Codex Codex-Version: codex-cli 0.164.0 Model: gpt-6-astra Reasoning-Effort: xhigh --- doc/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index c9feba1251..78b3bc2a85 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -142,9 +142,9 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] -# External inventories are optional cross-reference metadata. A stalled host -# must not consume the entire Read the Docs build budget; Sphinx can continue -# with its other inventories after reporting the failed request. +# External inventories are optional cross-reference metadata. Limit connection +# and read-inactivity waits so Sphinx can warn and continue if a host stalls. +# This is not a deadline for the full download or documentation build. intersphinx_timeout = 30 intersphinx_mapping = { "numpy": ("https://docs.scipy.org/doc/numpy/", None),