diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77d17cc65b..72d7f1a458 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -238,8 +238,6 @@ jobs: pip3 install --upgrade --force-reinstall ruff==0.11.0 python3 -m ruff check . python3 -m ruff check examples/mlperf/ --ignore E501 - - name: Lint tinygrad with pylint - run: python -m pylint tinygrad/ - name: Run mypy run: | python -m mypy --strict-equality --lineprecision-report . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3baff37e8..d64a3fbbff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,21 +20,15 @@ repos: language: system always_run: true pass_filenames: false - - id: tests - name: subset of tests - entry: env PYTHONPATH="." python3 -m pytest -n=4 test/test_ops.py test/test_dtype.py test/test_schedule.py test/test_assign.py - language: system - always_run: true - pass_filenames: false - id: example - name: multi device tests + name: test all devices entry: python3 test/external/external_test_example.py language: system always_run: true pass_filenames: false - - id: pylint - name: pylint - entry: python3 -m pylint tinygrad/ + - id: tests + name: subset of tests + entry: env PYTHONPATH="." python3 -m pytest -n=8 test/test_ops.py test/test_dtype.py test/test_schedule.py test/test_assign.py language: system always_run: true pass_filenames: false \ No newline at end of file diff --git a/test/external/external_test_example.py b/test/external/external_test_example.py index 86c3958c80..a2740f3a5e 100644 --- a/test/external/external_test_example.py +++ b/test/external/external_test_example.py @@ -58,8 +58,8 @@ class TestExample(unittest.TestCase): print(f"WARNING: {device} test isn't running") return - x = Tensor.eye(64, device=device, requires_grad=True) - y = Tensor.eye(64, device=device, requires_grad=True) + x = Tensor.eye(8, device=device, requires_grad=True) + y = Tensor.eye(8, device=device, requires_grad=True) z = y.matmul(x).sum() z.backward() diff --git a/test/test_tiny.py b/test/test_tiny.py index 0c18e6a0a8..72f274a6b8 100644 --- a/test/test_tiny.py +++ b/test/test_tiny.py @@ -134,8 +134,8 @@ class TestTiny(unittest.TestCase): def test_mnist_backward(self): # NOTE: we don't have the whole model here for speed layers = [ - nn.Conv2d(1, 32, 5), Tensor.relu, - nn.Conv2d(32, 32, 5), Tensor.relu] + nn.Conv2d(1, 8, 5), Tensor.relu, + nn.Conv2d(8, 8, 5), Tensor.relu] # replace random weights with ones # TODO: there's a bug here where it's tying two of the biases together. we need UNIQUE const @@ -144,7 +144,7 @@ class TestTiny(unittest.TestCase): # realize gradients for x in nn.state.get_parameters(layers): x.requires_grad_() - Tensor.empty(4, 1, 28, 28).sequential(layers).sum().backward() + Tensor.empty(4, 1, 14, 14).sequential(layers).sum().backward() Tensor.realize(*[x.grad for x in nn.state.get_parameters(layers) if x.grad is not None]) # *** image *** diff --git a/tinygrad/renderer/__init__.py b/tinygrad/renderer/__init__.py index 068e8afb26..87ddce695a 100644 --- a/tinygrad/renderer/__init__.py +++ b/tinygrad/renderer/__init__.py @@ -7,7 +7,7 @@ from tinygrad.uop.ops import Ops, UOp, sym_infer, sint, Variable, ssimplify, Gro from tinygrad.dtype import AddrSpace, PtrDType if TYPE_CHECKING: from tinygrad.codegen.opt.tc import TensorCore - from tinygrad.codegen.opt.kernel import Opt + from tinygrad.codegen.opt import Opt @dataclass(frozen=True) class Estimates: