From b8cd40f3e13a225efd6051f99fe08cefec67f3dd Mon Sep 17 00:00:00 2001 From: zhouzaida Date: Mon, 11 Sep 2023 10:00:36 +0800 Subject: [PATCH 1/7] Fix pydantic version to fix mlflow unit tests --- requirements/tests.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/tests.txt b/requirements/tests.txt index 639bfe7665..1a336829a3 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -8,4 +8,5 @@ lmdb mlflow neptune parameterized +pydantic==1.10.9 pytest From e35530a6560cf2ebd961fb41298ecb4151ee7298 Mon Sep 17 00:00:00 2001 From: zhouzaida Date: Mon, 11 Sep 2023 10:15:49 +0800 Subject: [PATCH 2/7] fix pytest in windows --- .github/workflows/merge_stage_test.yml | 4 ++-- .github/workflows/pr_stage_test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/merge_stage_test.yml b/.github/workflows/merge_stage_test.yml index 33d2c13f4a..e23097f69a 100644 --- a/.github/workflows/merge_stage_test.yml +++ b/.github/workflows/merge_stage_test.yml @@ -299,9 +299,9 @@ jobs: pip install openmim mim install mmcv - name: Run CPU unittests - run: pytest tests/ --ignore tests/test_dist + run: python -m pytest tests/ --ignore tests/test_dist if: ${{ matrix.platform == 'cpu' }} - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited - run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py + run: python -m pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py if: ${{ matrix.platform == 'cu111' }} diff --git a/.github/workflows/pr_stage_test.yml b/.github/workflows/pr_stage_test.yml index 9ab31ebfe0..d1e4555e39 100644 --- a/.github/workflows/pr_stage_test.yml +++ b/.github/workflows/pr_stage_test.yml @@ -164,9 +164,9 @@ jobs: pip install openmim mim install mmcv - name: Run CPU unittests - run: pytest tests/ --ignore tests/test_dist + run: python -m pytest tests/ --ignore tests/test_dist if: ${{ matrix.platform == 'cpu' }} - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited - run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py + run: python -m pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py if: ${{ matrix.platform == 'cu111' }} From 7a342a2cd92017d6c10c341fb4505eb1194c98c9 Mon Sep 17 00:00:00 2001 From: zhouzaida Date: Fri, 15 Sep 2023 23:24:40 +0800 Subject: [PATCH 3/7] debug --- .github/workflows/pr_stage_test.yml | 224 ++++++++++++++-------------- 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/.github/workflows/pr_stage_test.yml b/.github/workflows/pr_stage_test.yml index d1e4555e39..8835b8cdb2 100644 --- a/.github/workflows/pr_stage_test.yml +++ b/.github/workflows/pr_stage_test.yml @@ -19,118 +19,118 @@ concurrency: cancel-in-progress: true jobs: - build_cpu: - runs-on: ubuntu-22.04 - strategy: - matrix: - python-version: [3.7] - include: - - torch: 1.8.1 - torchvision: 0.9.1 - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Upgrade pip - run: python -m pip install pip --upgrade - - name: Upgrade wheel - run: python -m pip install wheel --upgrade - - name: Install PyTorch - run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html - - name: Build MMEngine from source - run: pip install -e . -v - - name: Install unit tests dependencies - run: | - pip install -r requirements/tests.txt - pip install openmim - mim install mmcv - - name: Run unittests and generate coverage report - run: | - coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist - coverage xml - coverage report -m - # Upload coverage report for python3.7 && pytorch1.8.1 cpu - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - file: ./coverage.xml - flags: unittests - env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + # build_cpu: + # runs-on: ubuntu-22.04 + # strategy: + # matrix: + # python-version: [3.7] + # include: + # - torch: 1.8.1 + # torchvision: 0.9.1 + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Upgrade pip + # run: python -m pip install pip --upgrade + # - name: Upgrade wheel + # run: python -m pip install wheel --upgrade + # - name: Install PyTorch + # run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html + # - name: Build MMEngine from source + # run: pip install -e . -v + # - name: Install unit tests dependencies + # run: | + # pip install -r requirements/tests.txt + # pip install openmim + # mim install mmcv + # - name: Run unittests and generate coverage report + # run: | + # coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist + # coverage xml + # coverage report -m + # # Upload coverage report for python3.7 && pytorch1.8.1 cpu + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v3 + # with: + # file: ./coverage.xml + # flags: unittests + # env_vars: OS,PYTHON + # name: codecov-umbrella + # fail_ci_if_error: false - build_cu102: - runs-on: ubuntu-22.04 - container: - image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel - env: - MKL_THREADING_LAYER: GNU - strategy: - matrix: - python-version: [3.7] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Upgrade pip - run: pip install pip --upgrade - - name: Fetch GPG keys - run: | - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub - - name: Install system dependencies - run: apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 - - name: Build MMEngine from source - run: pip install -e . -v - - name: Install unit tests dependencies - run: | - pip install -r requirements/tests.txt - pip install openmim - mim install mmcv - - name: Run unittests and generate coverage report - run: | - coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist - coverage xml - coverage report -m + # build_cu102: + # runs-on: ubuntu-22.04 + # container: + # image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel + # env: + # MKL_THREADING_LAYER: GNU + # strategy: + # matrix: + # python-version: [3.7] + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Upgrade pip + # run: pip install pip --upgrade + # - name: Fetch GPG keys + # run: | + # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub + # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub + # - name: Install system dependencies + # run: apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 + # - name: Build MMEngine from source + # run: pip install -e . -v + # - name: Install unit tests dependencies + # run: | + # pip install -r requirements/tests.txt + # pip install openmim + # mim install mmcv + # - name: Run unittests and generate coverage report + # run: | + # coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist + # coverage xml + # coverage report -m - build_cu117: - runs-on: ubuntu-22.04 - container: - image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel - strategy: - matrix: - python-version: [3.9] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Upgrade pip - run: pip install pip --upgrade - - name: Fetch GPG keys - run: | - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub - - name: Install system dependencies - run: apt-get update && apt-get install -y git ffmpeg libturbojpeg - - name: Build MMEngine from source - run: pip install -e . -v - - name: Install unit tests dependencies - run: | - pip install -r requirements/tests.txt - pip install openmim - mim install mmcv - # Distributed related unit test may randomly error in PyTorch 1.13.0 - - name: Run unittests and generate coverage report - run: | - coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist/ - coverage xml - coverage report -m + # build_cu117: + # runs-on: ubuntu-22.04 + # container: + # image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel + # strategy: + # matrix: + # python-version: [3.9] + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Upgrade pip + # run: pip install pip --upgrade + # - name: Fetch GPG keys + # run: | + # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub + # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub + # - name: Install system dependencies + # run: apt-get update && apt-get install -y git ffmpeg libturbojpeg + # - name: Build MMEngine from source + # run: pip install -e . -v + # - name: Install unit tests dependencies + # run: | + # pip install -r requirements/tests.txt + # pip install openmim + # mim install mmcv + # # Distributed related unit test may randomly error in PyTorch 1.13.0 + # - name: Run unittests and generate coverage report + # run: | + # coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist/ + # coverage xml + # coverage report -m build_windows: runs-on: windows-2022 @@ -164,9 +164,9 @@ jobs: pip install openmim mim install mmcv - name: Run CPU unittests - run: python -m pytest tests/ --ignore tests/test_dist + run: pytest tests/ --ignore tests/test_dist if: ${{ matrix.platform == 'cpu' }} - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited - run: python -m pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py + run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py if: ${{ matrix.platform == 'cu111' }} From 26f7b5e795a99e8394dfe79647b9be19253abb4b Mon Sep 17 00:00:00 2001 From: zhouzaida Date: Fri, 15 Sep 2023 23:32:54 +0800 Subject: [PATCH 4/7] debug --- .github/workflows/pr_stage_test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_stage_test.yml b/.github/workflows/pr_stage_test.yml index 8835b8cdb2..7aa404082b 100644 --- a/.github/workflows/pr_stage_test.yml +++ b/.github/workflows/pr_stage_test.yml @@ -163,10 +163,11 @@ jobs: pip install -r requirements/tests.txt pip install openmim mim install mmcv + python -m pip install pytest - name: Run CPU unittests - run: pytest tests/ --ignore tests/test_dist + run: python -m pytest tests/ --ignore tests/test_dist if: ${{ matrix.platform == 'cpu' }} - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited - run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py + run: python -m pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py if: ${{ matrix.platform == 'cu111' }} From adc53d66e67808959462e27474b99bb7d492c904 Mon Sep 17 00:00:00 2001 From: zhouzaida Date: Fri, 15 Sep 2023 23:38:22 +0800 Subject: [PATCH 5/7] debug --- .github/workflows/pr_stage_test.yml | 7 +++---- requirements/tests.txt | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_stage_test.yml b/.github/workflows/pr_stage_test.yml index 7aa404082b..dc9170a963 100644 --- a/.github/workflows/pr_stage_test.yml +++ b/.github/workflows/pr_stage_test.yml @@ -160,10 +160,9 @@ jobs: run: pip install -e . -v - name: Install unit tests dependencies run: | - pip install -r requirements/tests.txt - pip install openmim - mim install mmcv - python -m pip install pytest + python -m pip install -r requirements/tests.txt + python -m pip install openmim + python -m mim install mmcv - name: Run CPU unittests run: python -m pytest tests/ --ignore tests/test_dist if: ${{ matrix.platform == 'cpu' }} diff --git a/requirements/tests.txt b/requirements/tests.txt index 1a336829a3..fccc775b90 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -1,4 +1,4 @@ -aim +aim;sys_platform!='win32' clearml coverage dadaptation From acabfc03ff69dcee86b08b04cc99a2fd057aa7ae Mon Sep 17 00:00:00 2001 From: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Date: Sat, 16 Sep 2023 08:34:49 +0800 Subject: [PATCH 6/7] Apply suggestions from code review --- .github/workflows/merge_stage_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge_stage_test.yml b/.github/workflows/merge_stage_test.yml index e23097f69a..33d2c13f4a 100644 --- a/.github/workflows/merge_stage_test.yml +++ b/.github/workflows/merge_stage_test.yml @@ -299,9 +299,9 @@ jobs: pip install openmim mim install mmcv - name: Run CPU unittests - run: python -m pytest tests/ --ignore tests/test_dist + run: pytest tests/ --ignore tests/test_dist if: ${{ matrix.platform == 'cpu' }} - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited - run: python -m pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py + run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py if: ${{ matrix.platform == 'cu111' }} From 41f33f3430e789e007b4c1c08aa81f8a793c6b85 Mon Sep 17 00:00:00 2001 From: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Date: Sat, 16 Sep 2023 08:35:31 +0800 Subject: [PATCH 7/7] Update pr_stage_test.yml --- .github/workflows/pr_stage_test.yml | 230 ++++++++++++++-------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/.github/workflows/pr_stage_test.yml b/.github/workflows/pr_stage_test.yml index dc9170a963..9ab31ebfe0 100644 --- a/.github/workflows/pr_stage_test.yml +++ b/.github/workflows/pr_stage_test.yml @@ -19,118 +19,118 @@ concurrency: cancel-in-progress: true jobs: - # build_cpu: - # runs-on: ubuntu-22.04 - # strategy: - # matrix: - # python-version: [3.7] - # include: - # - torch: 1.8.1 - # torchvision: 0.9.1 - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Upgrade pip - # run: python -m pip install pip --upgrade - # - name: Upgrade wheel - # run: python -m pip install wheel --upgrade - # - name: Install PyTorch - # run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html - # - name: Build MMEngine from source - # run: pip install -e . -v - # - name: Install unit tests dependencies - # run: | - # pip install -r requirements/tests.txt - # pip install openmim - # mim install mmcv - # - name: Run unittests and generate coverage report - # run: | - # coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist - # coverage xml - # coverage report -m - # # Upload coverage report for python3.7 && pytorch1.8.1 cpu - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@v3 - # with: - # file: ./coverage.xml - # flags: unittests - # env_vars: OS,PYTHON - # name: codecov-umbrella - # fail_ci_if_error: false + build_cpu: + runs-on: ubuntu-22.04 + strategy: + matrix: + python-version: [3.7] + include: + - torch: 1.8.1 + torchvision: 0.9.1 + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: python -m pip install pip --upgrade + - name: Upgrade wheel + run: python -m pip install wheel --upgrade + - name: Install PyTorch + run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html + - name: Build MMEngine from source + run: pip install -e . -v + - name: Install unit tests dependencies + run: | + pip install -r requirements/tests.txt + pip install openmim + mim install mmcv + - name: Run unittests and generate coverage report + run: | + coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist + coverage xml + coverage report -m + # Upload coverage report for python3.7 && pytorch1.8.1 cpu + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false - # build_cu102: - # runs-on: ubuntu-22.04 - # container: - # image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel - # env: - # MKL_THREADING_LAYER: GNU - # strategy: - # matrix: - # python-version: [3.7] - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Upgrade pip - # run: pip install pip --upgrade - # - name: Fetch GPG keys - # run: | - # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub - # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub - # - name: Install system dependencies - # run: apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 - # - name: Build MMEngine from source - # run: pip install -e . -v - # - name: Install unit tests dependencies - # run: | - # pip install -r requirements/tests.txt - # pip install openmim - # mim install mmcv - # - name: Run unittests and generate coverage report - # run: | - # coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist - # coverage xml - # coverage report -m + build_cu102: + runs-on: ubuntu-22.04 + container: + image: pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel + env: + MKL_THREADING_LAYER: GNU + strategy: + matrix: + python-version: [3.7] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: pip install pip --upgrade + - name: Fetch GPG keys + run: | + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub + - name: Install system dependencies + run: apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 + - name: Build MMEngine from source + run: pip install -e . -v + - name: Install unit tests dependencies + run: | + pip install -r requirements/tests.txt + pip install openmim + mim install mmcv + - name: Run unittests and generate coverage report + run: | + coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist + coverage xml + coverage report -m - # build_cu117: - # runs-on: ubuntu-22.04 - # container: - # image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel - # strategy: - # matrix: - # python-version: [3.9] - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Upgrade pip - # run: pip install pip --upgrade - # - name: Fetch GPG keys - # run: | - # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub - # apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub - # - name: Install system dependencies - # run: apt-get update && apt-get install -y git ffmpeg libturbojpeg - # - name: Build MMEngine from source - # run: pip install -e . -v - # - name: Install unit tests dependencies - # run: | - # pip install -r requirements/tests.txt - # pip install openmim - # mim install mmcv - # # Distributed related unit test may randomly error in PyTorch 1.13.0 - # - name: Run unittests and generate coverage report - # run: | - # coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist/ - # coverage xml - # coverage report -m + build_cu117: + runs-on: ubuntu-22.04 + container: + image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel + strategy: + matrix: + python-version: [3.9] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: pip install pip --upgrade + - name: Fetch GPG keys + run: | + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub + - name: Install system dependencies + run: apt-get update && apt-get install -y git ffmpeg libturbojpeg + - name: Build MMEngine from source + run: pip install -e . -v + - name: Install unit tests dependencies + run: | + pip install -r requirements/tests.txt + pip install openmim + mim install mmcv + # Distributed related unit test may randomly error in PyTorch 1.13.0 + - name: Run unittests and generate coverage report + run: | + coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist/ + coverage xml + coverage report -m build_windows: runs-on: windows-2022 @@ -160,13 +160,13 @@ jobs: run: pip install -e . -v - name: Install unit tests dependencies run: | - python -m pip install -r requirements/tests.txt - python -m pip install openmim - python -m mim install mmcv + pip install -r requirements/tests.txt + pip install openmim + mim install mmcv - name: Run CPU unittests - run: python -m pytest tests/ --ignore tests/test_dist + run: pytest tests/ --ignore tests/test_dist if: ${{ matrix.platform == 'cpu' }} - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited - run: python -m pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py + run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py if: ${{ matrix.platform == 'cu111' }}