Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Split the half precision tests workflow (#2118)

João Gustavo A. Amorim6ccdfd9184f6
diff --git a/.github/workflows/scheduled_test_cpu.yml b/.github/workflows/scheduled_test_cpu.yml
index e239dc491..6e5f2028a 100644
--- a/.github/workflows/scheduled_test_cpu.yml
+++ b/.github/workflows/scheduled_test_cpu.yml
@@ -1,4 +1,4 @@
-name: (scheduled) Tests on CPU
+name: Tests on CPU (scheduled)
on:
push:
diff --git a/.github/workflows/scheduled_test_cpu_half.yml b/.github/workflows/scheduled_test_cpu_half.yml
new file mode 100644
index 000000000..780e9ba46
--- /dev/null
+++ b/.github/workflows/scheduled_test_cpu_half.yml
@@ -0,0 +1,46 @@
+name: Tests on CPU (float16)
+
+on:
+ schedule:
+ - cron: "0 4 * * *"
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ tests-cpu:
+ name: ${{ matrix.os }} - python-${{ matrix.python-version }}, torch-${{ matrix.pytorch-version }}, ${{ matrix.pytorch-dtype }}
+ runs-on: ${{ matrix.os }}-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ os: ['Ubuntu', 'Windows', 'MacOS']
+ python-version: ['3.7', '3.8']
+ pytorch-version: ['1.9.1', '1.10.2', '1.12.1', '1.13.1']
+ pytorch-dtype: ['float16']
+
+ steps:
+ - name: Checkout kornia
+ uses: actions/checkout@v3
+
+ - name: Setting environment on ${{ matrix.os }} with python ${{ matrix.python-version }} and pytorch ${{ matrix.pytorch-version }}
+ uses: ./.github/actions/env
+ with:
+ python-version: ${{ matrix.python-version }}
+ pytorch-version: ${{ matrix.pytorch-version }}
+
+ - name: Run CPU tests ${{ matrix.pytorch-dtype }}
+ shell: bash -l {0}
+ run: pytest -v --device cpu --dtype ${{ matrix.pytorch-dtype }} --cov=kornia --cov-report xml ./test
+
+
+ - if: always()
+ name: Upload coverage
+ uses: codecov/codecov-action@v3
+ with:
+ file: coverage.xml
+ token: ${{ secrets.CODECOV_TOKEN }} # to not depend on build via GH API
+ flags: cpu,${{ matrix.os }}_py-${{ matrix.python-version }}_pt-${{ matrix.pytorch-version }}_${{ matrix.pytorch-dtype }}
+ name: cpu-coverage
diff --git a/README.md b/README.md
index d2b9f60e2..d30203759 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,7 @@ English | [简体中文](README_zh-CN.md)
[![tests-cpu](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu.yml/badge.svg?event=schedule&&branch=master)](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu.yml)
[![tests-cpu-nightly](https://github.com/kornia/kornia/actions/workflows/scheduled_test_nightly.yml/badge.svg?event=schedule&&branch=master)](https://github.com/kornia/kornia/actions/workflows/scheduled_test_nightly.yml)
[![tests-cuda](https://github.com/kornia/kornia/actions/workflows/tests_cuda.yml/badge.svg)](https://github.com/kornia/kornia/actions/workflows/tests_cuda.yml)
+[![tests-cpu-float16](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu_half.yml/badge.svg?event=schedule&&branch=master)](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu_half.yml)
[![codecov](https://codecov.io/gh/kornia/kornia/branch/master/graph/badge.svg?token=FzCb7e0Bso)](https://codecov.io/gh/kornia/kornia)
[![Documentation Status](https://readthedocs.org/projects/kornia/badge/?version=latest)](https://kornia.readthedocs.io/en/latest/?badge=latest)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/kornia/kornia/master.svg)](https://results.pre-commit.ci/latest/github/kornia/kornia/master)
diff --git a/README_zh-CN.md b/README_zh-CN.md
index 0496f9ba9..a27eb31c7 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -28,6 +28,7 @@
[![tests-cpu](https://github.com/kornia/kornia/actions/workflows/tests_cpu.yml/badge.svg)](https://github.com/kornia/kornia/actions/workflows/tests_cpu.yml)
[![tests-cpu-nightly](https://github.com/kornia/kornia/actions/workflows/scheduled_test_nightly.yml/badge.svg?event=schedule&&branch=master)](https://github.com/kornia/kornia/actions/workflows/scheduled_test_nightly.yml)
[![tests-cuda](https://github.com/kornia/kornia/actions/workflows/tests_cuda.yml/badge.svg)](https://github.com/kornia/kornia/actions/workflows/tests_cuda.yml)
+[![tests-cpu-float16](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu_half.yml/badge.svg?event=schedule&&branch=master)](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu_half.yml)
[![codecov](https://codecov.io/gh/kornia/kornia/branch/master/graph/badge.svg?token=FzCb7e0Bso)](https://codecov.io/gh/kornia/kornia)
[![Documentation Status](https://readthedocs.org/projects/kornia/badge/?version=latest)](https://kornia.readthedocs.io/en/latest/?badge=latest)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/kornia/kornia/master.svg)](https://results.pre-commit.ci/latest/github/kornia/kornia/master)