diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index c1d44eb15c..f2bac74764 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -56,7 +56,9 @@ jobs: # https://github.com/pypa/setuptools_scm/issues/480 fetch-depth: 0 - name: Install uv - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.24/uv-installer.sh | sh + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + with: + version: "0.12.0" if: runner.os != 'Linux' - name: Build wheels uses: pypa/cibuildwheel@v4.1 @@ -68,6 +70,9 @@ jobs: CUDA_VERSION: ${{ matrix.cuda_version }} DP_PKG_NAME: ${{ matrix.dp_pkg_name }} CIBW_BUILD_FRONTEND: "build[uv]" + # uv defaults to 50 concurrent downloads, which can exhaust the + # macOS runner's socket buffers while installing wheel test extras. + UV_CONCURRENT_DOWNLOADS: ${{ startsWith(matrix.platform_id, 'macosx_') && '8' || '50' }} - uses: actions/upload-artifact@v7 with: name: cibw-cp${{ matrix.python }}-${{ matrix.platform_id }}-cu${{ matrix.cuda_version }}-${{ strategy.job-index }} diff --git a/.github/workflows/test_cc.yml b/.github/workflows/test_cc.yml index 27086047d3..13e3e51a32 100644 --- a/.github/workflows/test_cc.yml +++ b/.github/workflows/test_cc.yml @@ -15,7 +15,12 @@ jobs: testcc: name: Test C++ runs-on: ${{ matrix.check_memleak == false && github.repository_owner == 'deepmodeling' && 'cpu' || 'ubuntu-22.04' }} + # Paddle's external interface download is occasionally unavailable. Keep + # exercising these configurations without making that outage blocking. + continue-on-error: ${{ matrix.enable_paddle }} strategy: + # An allowed Paddle failure must not cancel the other backend jobs. + fail-fast: false matrix: # Only regular jobs run the LAMMPS tests. Use self-hosted CPU runners # for those jobs in deepmodeling, with a hosted fallback for forks. diff --git a/.github/workflows/test_cuda.yml b/.github/workflows/test_cuda.yml index f978f83f91..866eca155e 100644 --- a/.github/workflows/test_cuda.yml +++ b/.github/workflows/test_cuda.yml @@ -13,6 +13,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true name: Test CUDA +env: + # Temporarily disable Paddle in CUDA CI while its external downloads are + # unreliable. Keep this switch explicit so the coverage can be restored. + DP_CI_ALLOW_MISSING_PADDLE: "1" + DP_ENABLE_PADDLE: "0" jobs: test_python: name: Test Python on CUDA @@ -53,7 +58,6 @@ jobs: - run: | export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])') export TENSORFLOW_ROOT=$(python -c 'import importlib.util,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)') - 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" source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py --reinstall-package deepmd-kit # See https://github.com/jax-ml/jax/issues/29042 source/install/uv_with_retry.sh pip install --system -U 'nvidia-cublas-cu12>=12.9.0.13' @@ -62,7 +66,7 @@ jobs: DP_ENABLE_NATIVE_OPTIMIZATION: 1 DP_ENABLE_PYTORCH: 1 - run: dp --version - - run: python -m pytest source/tests + - run: python -m pytest source/tests --ignore=source/tests/pd env: NUM_WORKERS: 0 CUDA_VISIBLE_DEVICES: 0 @@ -106,7 +110,6 @@ jobs: - run: | export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])') export TENSORFLOW_ROOT=$(python -c 'import importlib.util,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)') - 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" source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py --reinstall-package deepmd-kit # See https://github.com/jax-ml/jax/issues/29042 source/install/uv_with_retry.sh pip install --system -U 'nvidia-cublas-cu12>=12.9.0.13' @@ -127,12 +130,10 @@ jobs: CMAKE_GENERATOR: Ninja DP_VARIANT: cuda DP_USE_MPICH2: 1 + ENABLE_PADDLE: FALSE - run: | export LD_LIBRARY_PATH=$CUDA_PATH/lib64:/usr/lib/x86_64-linux-gnu/:$GITHUB_WORKSPACE/dp_test/lib:$LD_LIBRARY_PATH export PATH=$GITHUB_WORKSPACE/dp_test/bin:$PATH - cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/paddle/lib/* $GITHUB_WORKSPACE/dp_test/lib/ - cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* $GITHUB_WORKSPACE/dp_test/lib/ - cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* $GITHUB_WORKSPACE/dp_test/lib/ python -m pytest -s source/lmp/tests || (cat log.lammps && exit 1) python -m pytest source/ipi/tests env: @@ -141,6 +142,7 @@ jobs: TF_INTER_OP_PARALLELISM_THREADS: 1 LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp CUDA_VISIBLE_DEVICES: 0 + ENABLE_PADDLE: 0 pass: name: Pass testing on CUDA needs: [test_python, test_cc] diff --git a/source/tests/consistent/common.py b/source/tests/consistent/common.py index 44632ca6eb..0247167604 100644 --- a/source/tests/consistent/common.py +++ b/source/tests/consistent/common.py @@ -62,11 +62,16 @@ INSTALLED_JAX = Backend.get_backend("jax")().is_available() INSTALLED_PD = Backend.get_backend("paddle")().is_available() INSTALLED_ARRAY_API_STRICT = find_spec("array_api_strict") is not None +# CUDA CI may explicitly omit Paddle while its external artifacts are +# unavailable, without disabling the remaining cross-backend checks. +CI_ALLOW_MISSING_PADDLE = os.environ.get("DP_CI_ALLOW_MISSING_PADDLE") == "1" if ( os.environ.get("CI") and not RUN_TF2_BACKEND_TESTS - and not (INSTALLED_TF and INSTALLED_PT and INSTALLED_PD) + and not ( + INSTALLED_TF and INSTALLED_PT and (INSTALLED_PD or CI_ALLOW_MISSING_PADDLE) + ) ): raise ImportError("TensorFlow, PyTorch or Paddle should be tested in the CI")