Skip to content

Commit

Permalink
tests are 20% faster (tinygrad#529)
Browse files Browse the repository at this point in the history
* pytorch CPU

* no cache, it's slower

* pytorch cpu for real

* remove double onnx
  • Loading branch information
geohot authored Feb 6, 2023
1 parent 039de1b commit 90529d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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

Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"torch~=1.13.0",
"protobuf~=3.19.0",
"pytest",
"onnx",
"onnx~=1.12.0",
"onnx2torch",
],
},
Expand Down

0 comments on commit 90529d3

Please sign in to comment.