From 0d405fd5bc8d1574d14dbc2ce788eca903cf1185 Mon Sep 17 00:00:00 2001 From: James Roberts <37839840+jamesroberts@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:27:44 +0200 Subject: [PATCH] Parallelize CI tests (#535) --- .github/workflows/test.yml | 14 +++++++------- setup.py | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b2a0b55..ff852fdf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,9 +56,9 @@ jobs: - name: Install Dependencies run: pip install -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu - name: Run Pytest - run: LAZY=0 python -m pytest -s -v + run: LAZY=0 python -m pytest -s -v -n=auto - name: Run Pytest (lazy) - run: LAZY=1 python -m pytest -s -v + run: LAZY=1 python -m pytest -s -v -n=auto testllvm: name: LLVM Tests @@ -74,7 +74,7 @@ jobs: - name: Install Dependencies run: pip install -e '.[llvm,testing]' --extra-index-url https://download.pytorch.org/whl/cpu - name: Run Pytest OPT=2 - run: OPT=2 LLVM=1 python -m pytest -s -v + run: OPT=2 LLVM=1 python -m pytest -s -v -n=auto testtorch: name: Torch Tests @@ -90,9 +90,9 @@ jobs: - name: Install Dependencies run: pip install -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu - name: Run Pytest - run: LAZY=0 TORCH=1 python -m pytest -s -v + run: LAZY=0 TORCH=1 python -m pytest -s -v -n=auto - name: Run Pytest (lazy) - run: LAZY=1 TORCH=1 python -m pytest -s -v + run: LAZY=1 TORCH=1 python -m pytest -s -v -n=auto testgpu: name: GPU Tests @@ -118,7 +118,7 @@ jobs: - name: Run Optimizer Test run: OPT=2 GPU=1 python test/external_test_opt.py - name: Run Pytest (default) - run: OPT=1 GPU=1 python -m pytest -s -v + run: OPT=1 GPU=1 python -m pytest -s -v -n=auto testopencl: name: openpilot (OpenCL) Test @@ -160,4 +160,4 @@ jobs: - name: Build Docker run: docker build -t tinygrad -f test/Dockerfile . - name: Test Docker - run: docker run --rm tinygrad /usr/bin/env python3 -c "from tinygrad.tensor import Tensor; print(Tensor.eye(3).numpy())" \ No newline at end of file + run: docker run --rm tinygrad /usr/bin/env python3 -c "from tinygrad.tensor import Tensor; print(Tensor.eye(3).numpy())" diff --git a/setup.py b/setup.py index 12436be3..59c20017 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ setup(name='tinygrad', "torch~=1.13.0", "protobuf~=3.19.0", "pytest", + "pytest-xdist", "onnx~=1.12.0", "onnx2torch", ],