Skip to content

Commit f573ca0

Browse files
njzjznjzjz-bot
andauthored
ci: stabilize optional backend workflows (#5945)
## Summary - allow Paddle-only C++ matrix entries to fail without cancelling or blocking the other backend jobs - temporarily disable Paddle installation and tests in the CUDA workflow - replace the manual uv installer with astral-sh/setup-uv@v9, pin uv 0.12.0, and limit macOS dependency downloads to avoid runner socket-buffer exhaustion ## Failure analysis The referenced macOS ARM job successfully built and repaired the wheel. It failed while installing wheel test dependencies because downloading lmdb raised No buffer space available (os error 55). The macOS wheel remains blocking so release runs cannot silently publish without that artifact; limiting uv download concurrency targets the observed runner resource failure. ## Validation - prek run --files .github/workflows/test_cc.yml .github/workflows/test_cuda.yml .github/workflows/build_wheel.yml - ruff check . - ruff format . - actionlint on the changed workflows, excluding existing custom-runner and undefined optional matrix-field diagnostics Coding agent: Codex Codex version: codex-cli 0.144.6 Model: gpt-5.6-sol Reasoning effort: xhigh <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Improved wheel build reliability across supported operating systems. * Limited macOS build download concurrency for more consistent performance. * **Tests** * Improved test workflow resilience when Paddle-enabled checks encounter failures. * Disabled Paddle-specific setup in CUDA test runs. * Allowed CUDA and backend checks to continue independently when Paddle is unavailable. * Continued requiring TensorFlow and PyTorch for applicable test runs. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: njzjz-bot <njzjz-bot@users.noreply.github.com>
1 parent cc689a7 commit f573ca0

4 files changed

Lines changed: 25 additions & 8 deletions

File tree

.github/workflows/build_wheel.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ jobs:
5656
# https://github.com/pypa/setuptools_scm/issues/480
5757
fetch-depth: 0
5858
- name: Install uv
59-
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.24/uv-installer.sh | sh
59+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
60+
with:
61+
version: "0.12.0"
6062
if: runner.os != 'Linux'
6163
- name: Build wheels
6264
uses: pypa/cibuildwheel@v4.1
@@ -68,6 +70,9 @@ jobs:
6870
CUDA_VERSION: ${{ matrix.cuda_version }}
6971
DP_PKG_NAME: ${{ matrix.dp_pkg_name }}
7072
CIBW_BUILD_FRONTEND: "build[uv]"
73+
# uv defaults to 50 concurrent downloads, which can exhaust the
74+
# macOS runner's socket buffers while installing wheel test extras.
75+
UV_CONCURRENT_DOWNLOADS: ${{ startsWith(matrix.platform_id, 'macosx_') && '8' || '50' }}
7176
- uses: actions/upload-artifact@v7
7277
with:
7378
name: cibw-cp${{ matrix.python }}-${{ matrix.platform_id }}-cu${{ matrix.cuda_version }}-${{ strategy.job-index }}

.github/workflows/test_cc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ jobs:
1515
testcc:
1616
name: Test C++
1717
runs-on: ${{ matrix.check_memleak == false && github.repository_owner == 'deepmodeling' && 'cpu' || 'ubuntu-22.04' }}
18+
# Paddle's external interface download is occasionally unavailable. Keep
19+
# exercising these configurations without making that outage blocking.
20+
continue-on-error: ${{ matrix.enable_paddle }}
1821
strategy:
22+
# An allowed Paddle failure must not cancel the other backend jobs.
23+
fail-fast: false
1924
matrix:
2025
# Only regular jobs run the LAMMPS tests. Use self-hosted CPU runners
2126
# for those jobs in deepmodeling, with a hosted fallback for forks.

.github/workflows/test_cuda.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
1414
cancel-in-progress: true
1515
name: Test CUDA
16+
env:
17+
# Temporarily disable Paddle in CUDA CI while its external downloads are
18+
# unreliable. Keep this switch explicit so the coverage can be restored.
19+
DP_CI_ALLOW_MISSING_PADDLE: "1"
20+
DP_ENABLE_PADDLE: "0"
1621
jobs:
1722
test_python:
1823
name: Test Python on CUDA
@@ -53,7 +58,6 @@ jobs:
5358
- run: |
5459
export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])')
5560
export TENSORFLOW_ROOT=$(python -c 'import importlib.util,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')
56-
pip install --find-links "https://www.paddlepaddle.org.cn/packages/nightly/cu126/paddlepaddle-gpu/" --index-url https://pypi.org/simple --trusted-host www.paddlepaddle.org.cn --trusted-host paddlepaddle.org.cn "paddlepaddle-gpu==3.4.0.dev20260310"
5761
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py --reinstall-package deepmd-kit
5862
# See https://github.com/jax-ml/jax/issues/29042
5963
source/install/uv_with_retry.sh pip install --system -U 'nvidia-cublas-cu12>=12.9.0.13'
@@ -62,7 +66,7 @@ jobs:
6266
DP_ENABLE_NATIVE_OPTIMIZATION: 1
6367
DP_ENABLE_PYTORCH: 1
6468
- run: dp --version
65-
- run: python -m pytest source/tests
69+
- run: python -m pytest source/tests --ignore=source/tests/pd
6670
env:
6771
NUM_WORKERS: 0
6872
CUDA_VISIBLE_DEVICES: 0
@@ -106,7 +110,6 @@ jobs:
106110
- run: |
107111
export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])')
108112
export TENSORFLOW_ROOT=$(python -c 'import importlib.util,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')
109-
pip install --find-links "https://www.paddlepaddle.org.cn/packages/nightly/cu126/paddlepaddle-gpu/" --index-url https://pypi.org/simple --trusted-host www.paddlepaddle.org.cn --trusted-host paddlepaddle.org.cn "paddlepaddle-gpu==3.4.0.dev20260310"
110113
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py --reinstall-package deepmd-kit
111114
# See https://github.com/jax-ml/jax/issues/29042
112115
source/install/uv_with_retry.sh pip install --system -U 'nvidia-cublas-cu12>=12.9.0.13'
@@ -127,12 +130,10 @@ jobs:
127130
CMAKE_GENERATOR: Ninja
128131
DP_VARIANT: cuda
129132
DP_USE_MPICH2: 1
133+
ENABLE_PADDLE: FALSE
130134
- run: |
131135
export LD_LIBRARY_PATH=$CUDA_PATH/lib64:/usr/lib/x86_64-linux-gnu/:$GITHUB_WORKSPACE/dp_test/lib:$LD_LIBRARY_PATH
132136
export PATH=$GITHUB_WORKSPACE/dp_test/bin:$PATH
133-
cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/paddle/lib/* $GITHUB_WORKSPACE/dp_test/lib/
134-
cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* $GITHUB_WORKSPACE/dp_test/lib/
135-
cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* $GITHUB_WORKSPACE/dp_test/lib/
136137
python -m pytest -s source/lmp/tests || (cat log.lammps && exit 1)
137138
python -m pytest source/ipi/tests
138139
env:
@@ -141,6 +142,7 @@ jobs:
141142
TF_INTER_OP_PARALLELISM_THREADS: 1
142143
LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp
143144
CUDA_VISIBLE_DEVICES: 0
145+
ENABLE_PADDLE: 0
144146
pass:
145147
name: Pass testing on CUDA
146148
needs: [test_python, test_cc]

source/tests/consistent/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,16 @@
6262
INSTALLED_JAX = Backend.get_backend("jax")().is_available()
6363
INSTALLED_PD = Backend.get_backend("paddle")().is_available()
6464
INSTALLED_ARRAY_API_STRICT = find_spec("array_api_strict") is not None
65+
# CUDA CI may explicitly omit Paddle while its external artifacts are
66+
# unavailable, without disabling the remaining cross-backend checks.
67+
CI_ALLOW_MISSING_PADDLE = os.environ.get("DP_CI_ALLOW_MISSING_PADDLE") == "1"
6568

6669
if (
6770
os.environ.get("CI")
6871
and not RUN_TF2_BACKEND_TESTS
69-
and not (INSTALLED_TF and INSTALLED_PT and INSTALLED_PD)
72+
and not (
73+
INSTALLED_TF and INSTALLED_PT and (INSTALLED_PD or CI_ALLOW_MISSING_PADDLE)
74+
)
7075
):
7176
raise ImportError("TensorFlow, PyTorch or Paddle should be tested in the CI")
7277

0 commit comments

Comments
 (0)