Skip to content

Fix: raise error for non mixed type model #7485

Fix: raise error for non mixed type model

Fix: raise error for non mixed type model #7485

Workflow file for this run

on:
push:
branches-ignore:
- "gh-readonly-queue/**"
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
name: Test Python
jobs:
testpython:
name: Test Python
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
python: ["3.8", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: mpi4py/setup-mpi@v1
with:
mpi: openmpi
- run: python -m pip install -U uv
- run: uv pip install --system -e .[cpu,test,torch]
env:
# Please note that uv has some issues with finding
# existing TensorFlow package. Currently, it uses
# TensorFlow in the build dependency, but if it
# changes, setting `TENSORFLOW_ROOT`.
TENSORFLOW_VERSION: ${{ matrix.tf }}
DP_BUILD_TESTING: 1
- run: uv pip install --system --no-build-isolation horovod mpi4py
env:
HOROVOD_WITH_TENSORFLOW: 1
HOROVOD_WITHOUT_PYTORCH: 1
HOROVOD_WITHOUT_GLOO: 1
- run: dp --version
- name: Get durations from cache
uses: actions/cache@v4
with:
path: test_durations
# the key must never match, even when restarting workflows, as that
# will cause durations to get out of sync between groups, the
# combined durations will be loaded if available
key: test-durations-split-${{ github.run_id }}-${{ github.run_number}}-${{ matrix.python }}-${{ matrix.group }}
restore-keys: |
test-durations-combined-${{ matrix.python }}-${{ github.sha }}
test-durations-combined-${{ matrix.python }}
- run: pytest --cov=deepmd source/tests --durations=0 --splits 6 --group ${{ matrix.group }} --store-durations --durations-path=.test_durations_${{ matrix.group }} --splitting-algorithm least_duration
env:
NUM_WORKERS: 0
- name: Upload partial durations
uses: actions/upload-artifact@v4
with:
name: split-${{ matrix.python }}-${{ matrix.group }}
path: .test_durations_${{ matrix.group }}
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
update_durations:
name: Combine and update integration test durations
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.11"]
needs: testpython
steps:
- name: Get durations from cache
uses: actions/cache@v4
with:
path: .test_durations
# key won't match during the first run for the given commit, but
# restore-key will if there's a previous stored durations file,
# so cache will both be loaded and stored
key: test-durations-combined-${{ matrix.python }}-${{ github.sha }}
restore-keys: test-durations-combined-${{ matrix.python }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: split-${{ matrix.python }}-*
merge-multiple: true
- name: Combine test durations
run: jq '. + input' .test_durations_* > .test_durations
pass:
name: Pass testing Python
needs: [testpython, update_durations]
runs-on: ubuntu-latest
if: always()
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}