From 274d6e7e74108adeb6d4306e7f39b9c405f3c8d0 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 11 May 2024 22:33:02 +0200 Subject: [PATCH] `ultralytics 8.2.13` enable `--slow` CUDA tests (#12511) Signed-off-by: Glenn Jocher --- .github/workflows/ci.yaml | 11 ++++++++--- tests/test_cuda.py | 9 +-------- ultralytics/__init__.py | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bb0037d4..a623f5ce 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -200,7 +200,7 @@ jobs: shell: bash # for Windows compatibility run: | slow="" - if [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + if [[ "${{ github.event_name }}" =~ ^(schedule|workflow_dispatch)$ ]]; then pip install pycocotools mlflow "ray[tune]" slow="--slow" fi @@ -215,7 +215,7 @@ jobs: GPU: if: github.repository == 'ultralytics/ultralytics' && (github.event_name != 'workflow_dispatch' || github.event.inputs.gpu == 'true') - timeout-minutes: 60 + timeout-minutes: 360 runs-on: gpu-latest steps: - uses: actions/checkout@v4 @@ -226,7 +226,12 @@ jobs: yolo checks pip list - name: Pytest tests - run: pytest --cov=ultralytics/ --cov-report xml tests/test_cuda.py + run: | + slow="--slow" + if [[ "${{ github.event_name }}" =~ ^(schedule|workflow_dispatch)$ ]]; then + slow="--slow" + fi + pytest $slow --cov=ultralytics/ --cov-report xml tests/test_cuda.py - name: Upload Coverage Reports to CodeCov uses: codecov/codecov-action@v4 with: diff --git a/tests/test_cuda.py b/tests/test_cuda.py index 8b29966c..4e8d4c68 100644 --- a/tests/test_cuda.py +++ b/tests/test_cuda.py @@ -19,14 +19,6 @@ def test_checks(): assert torch.cuda.device_count() == CUDA_DEVICE_COUNT -@pytest.mark.slow -@pytest.mark.skipif(not CUDA_IS_AVAILABLE, reason="CUDA is not available") -def test_export_engine(): - """Test exporting the YOLO model to NVIDIA TensorRT format.""" - f = YOLO(MODEL).export(format="engine", device=0) - YOLO(f)(SOURCE, device=0) - - @pytest.mark.slow @pytest.mark.skipif(not CUDA_IS_AVAILABLE, reason="CUDA is not available") @pytest.mark.parametrize( @@ -49,6 +41,7 @@ def test_export_engine_matrix(task, dynamic, int8, half, batch): half=half, batch=batch, data=TASK2DATA[task], + workspace=1, # reduce workspace GB for less resource utilization during testing ) YOLO(file)([SOURCE] * batch, imgsz=64 if dynamic else 32) # exported model inference Path(file).unlink() # cleanup diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 45435e04..9277930b 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.2.12" +__version__ = "8.2.13" from ultralytics.data.explorer.explorer import Explorer from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld