sunnypilot v2026.002.000
version: sunnypilot v2026.002.000 (staging) date: 2026-07-21T07:44:02 master commit: 2c334ede443d7391d27575af8c854a095ba702a8
This commit is contained in:
commit
de77c89cf6
3995 files changed
+1260688
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import unittest
|
||||
from tinygrad import Device
|
||||
from tinygrad.helpers import Timing, Profiling
|
||||
|
||||
class TestDeviceSpeed(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.dev = Device[Device.DEFAULT]
|
||||
cls.empty = Device[Device.DEFAULT].renderer.render([])
|
||||
|
||||
def test_empty_compile(self):
|
||||
with Timing("compiler "):
|
||||
self.dev.compiler.compile(self.empty)
|
||||
|
||||
def test_empty_compile_twice(self):
|
||||
self.dev.compiler.compile(self.empty)
|
||||
with Timing("compiler "):
|
||||
self.dev.compiler.compile(self.empty)
|
||||
|
||||
def test_launch_speed(self):
|
||||
prg_bin = self.dev.compiler.compile(self.empty)
|
||||
prg = self.dev.runtime("test", prg_bin)
|
||||
for _ in range(10): prg() # ignore first launches
|
||||
with Timing("launch 1000x "):
|
||||
for _ in range(1000): prg()
|
||||
with Timing("launch 1000x with wait "):
|
||||
for _ in range(1000): prg(wait=True)
|
||||
|
||||
def test_profile_launch_speed(self):
|
||||
prg_bin = self.dev.compiler.compile(self.empty)
|
||||
prg = self.dev.runtime("test", prg_bin)
|
||||
for _ in range(10): prg() # ignore first launches
|
||||
with Profiling():
|
||||
for _ in range(1000): prg()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user