tests are 20% faster (#529)

* pytorch CPU

* no cache, it's slower

* pytorch cpu for real

* remove double onnx
This commit is contained in:
George Hotz 2023-02-06 07:56:14 -08:00 committed by GitHub
commit 90529d3750
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 17 deletions

View file

@ -32,7 +32,7 @@ jobs:
with:
python-version: 3.8
- name: Install dependencies
run: pip install -e '.[linting,testing]'
run: pip install -e '.[linting,testing]' --extra-index-url https://download.pytorch.org/whl/cpu
- name: Lint with pylint
run: python -m pylint --disable=all -e W0311 --jobs=0 --indent-string=' ' **/*.py
- name: Lint with flake8
@ -53,10 +53,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: setup.py
- name: Install Dependencies
run: pip install -e '.[testing]'
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
- name: Run Pytest (lazy)
@ -73,10 +71,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: setup.py
- name: Install Dependencies
run: pip install -e '.[llvm,testing]'
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
@ -91,10 +87,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: setup.py
- name: Install Dependencies
run: pip install -e '.[testing]'
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
- name: Run Pytest (lazy)
@ -119,10 +113,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: setup.py
- name: Install Dependencies
run: pip install -e '.[gpu,testing]'
run: pip install -e '.[gpu,testing]' --extra-index-url https://download.pytorch.org/whl/cpu
- name: Run Optimizer Test
run: OPT=2 GPU=1 python test/external_test_opt.py
- name: Run Pytest (default)
@ -147,10 +139,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: setup.py
- name: Install Dependencies
run: pip install -e '.[gpu,testing]'
run: pip install -e '.[gpu,testing]' --extra-index-url https://download.pytorch.org/whl/cpu
- name: Test GPU IMAGE ops
run: GPU=1 IMAGE=2 python3 test/test_ops.py
- name: Test openpilot model

View file

@ -36,7 +36,7 @@ setup(name='tinygrad',
"torch~=1.13.0",
"protobuf~=3.19.0",
"pytest",
"onnx",
"onnx~=1.12.0",
"onnx2torch",
],
},