dsp simulator (#8869)

* dsp simulator

* progress

* fix

* close on test tiny

* working

* less waste

* line savings

* Device DSP compiler

* mock DSP at the bottom

* DSP tests

* docker caching

* test update

* need load

* skip that test for CI DSP

* last touch

* ugh
This commit is contained in:
George Hotz
2025-02-04 09:45:04 +08:00
committed by GitHub
parent 836cf42c2e
commit 56fa5c1191
6 changed files with 142 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
# basic self-contained tests of the external functionality of tinygrad
import unittest, random
from tinygrad import Tensor, Context, Variable, TinyJit, dtypes, Device, nn
from tinygrad.helpers import IMAGE
from tinygrad.helpers import IMAGE, CI
class TestTiny(unittest.TestCase):
@@ -11,6 +11,10 @@ class TestTiny(unittest.TestCase):
out = Tensor([1.,2,3]) + Tensor([4.,5,6])
self.assertListEqual(out.tolist(), [5.0, 7.0, 9.0])
def test_plus_int(self):
out = Tensor([1,2,3], dtype=dtypes.int) + Tensor([4,5,6], dtype=dtypes.int)
self.assertListEqual(out.tolist(), [5, 7, 9])
def test_plus_big(self):
out = Tensor.ones(16).contiguous() + Tensor.ones(16).contiguous()
self.assertListEqual(out.tolist(), [2]*16)
@@ -82,7 +86,7 @@ class TestTiny(unittest.TestCase):
# *** a model ***
# TODO: this is failing because of how swizzling rewrites the ShapeTracker of the final STORE
@unittest.skipIf(IMAGE>0, "failing because of make things that can't be images not images")
@unittest.skipIf(IMAGE>0 or (CI and Device.DEFAULT == "DSP"), "failing because of make things that can't be images not images")
def test_mnist_model(self):
layers = [
nn.Conv2d(1, 32, 5), Tensor.relu,