rig up torch's testing framework [pr] (#9254)

* rig up torch's testing framework [pr]

* support more movement ops

* dec on expand

* fix tests

* work

* fix tests

* a few more

* decomps + opt hook

* installed pytest
This commit is contained in:
George Hotz
2025-02-26 18:46:22 +08:00
committed by GitHub
parent b3755370ae
commit 7780393460
4 changed files with 165 additions and 43 deletions

View File

@@ -153,9 +153,9 @@ jobs:
- name: Setup Environment
uses: ./.github/actions/setup-tinygrad
with:
key: torch-backend-pillow-torchvision-et
key: torch-backend-pillow-torchvision-et-pt
deps: testing_minimal
pydeps: "pillow torchvision expecttest"
pydeps: "pillow torchvision expecttest pytest"
- name: Install ninja
run: |
sudo apt update || true
@@ -164,14 +164,16 @@ jobs:
run: PYTHONPATH=. FORWARD_ONLY=1 TINY_BACKEND=1 python3 test/test_ops.py TestOps.test_add
- name: Test ResNet-18
run: PYTHONPATH=. DEBUG=2 python3 extra/torch_backend/example.py
- name: My (custom) tests
run: PYTHONPATH=. python3 extra/torch_backend/test.py
- name: Test one op in torch tests
run: PYTHONPATH=. python3 extra/torch_backend/torch_tests.py TestTinyBackendPRIVATEUSE1.test_runs_log_tiny_float32
run: PYTHONPATH=. DEBUG=2 python3 extra/torch_backend/torch_tests.py TestTinyBackendPRIVATEUSE1.test_unary_log_tiny_float32
- name: Test Ops with TINY_BACKEND (expect failure)
run: PYTHONPATH=. TINY_BACKEND=1 python3 -m pytest test/test_ops.py || true
- name: Test beautiful_mnist in torch with TINY_BACKEND (expect failure)
run: PYTHONPATH=. TORCH_DEBUG=1 TINY_BACKEND=1 python3 examples/other_mnist/beautiful_mnist_torch.py || true
run: PYTHONPATH=. TINY_BACKEND=1 python3 examples/other_mnist/beautiful_mnist_torch.py || true
- name: Test some torch tests (expect failure)
run: PYTHONPATH=. python3 extra/torch_backend/torch_tests.py || true
run: PYTHONPATH=. pytest extra/torch_backend/torch_tests.py -v --tb=no || true
tc:
name: Tensor Core tests