diff --git a/test/device/test_amd_llvm.py b/test/device/test_amd_llvm.py index 9fb9fa333c..0522f35750 100644 --- a/test/device/test_amd_llvm.py +++ b/test/device/test_amd_llvm.py @@ -1,10 +1,8 @@ import unittest -import numpy as np from tinygrad import Device from tinygrad.device import CompileError -from tinygrad.helpers import flat_mv -if Device.DEFAULT=="AMD": - from tinygrad.runtime.ops_amd import AMDAllocator, AMDDevice, AMDProgram +if Device.DEFAULT == "AMD": + # NOTE: if you don't gate this, LVP fails on Mac from tinygrad.runtime.support.compiler_amd import AMDLLVMCompiler @unittest.skipUnless(Device.DEFAULT == "AMD", "Runs only on AMD") @@ -18,16 +16,8 @@ entry: ret void } ''' - device = AMDDevice() compiler = AMDLLVMCompiler("gfx1100") - obj = compiler.compile(src) - allocator = AMDAllocator(device) - a = allocator.alloc(1*8) - prog = AMDProgram(device, "test", obj) - prog(a, wait=True) - na = np.empty(1, np.uint64) - allocator._copyout(flat_mv(na.data), a) - assert na == [0x1234567800000005] + compiler.compile(src) def test_compiler_diag_error(self): src = """ diff --git a/test/device/test_hcq.py b/test/device/test_hcq.py index dceca7d5bc..54b55592bc 100644 --- a/test/device/test_hcq.py +++ b/test/device/test_hcq.py @@ -224,7 +224,8 @@ class TestHCQ(unittest.TestCase): def test_copy_64bit(self): if TestHCQ.d0.hw_copy_queue_t is None: self.skipTest("device does not support copy queue") - for sz in [(1 << 32) - 1, (1 << 32), (1 << 32) + 1, (5 << 30), (6 << 30) - 0x4642ee1]: + # NOTE: these must be a multiple of 8 for .view(fmt='Q') to work + for sz in [(1 << 32) - 8, (1 << 32), (1 << 32) + 8, (5 << 30), (6 << 30) - 0x4642ee0]: buf1 = Buffer(Device.DEFAULT, sz, dtypes.int8, options=BufferSpec(nolru=True)).ensure_allocated() buf2 = Buffer(Device.DEFAULT, sz, dtypes.int8, options=BufferSpec(host=True, nolru=True)).ensure_allocated() diff --git a/test/models/test_whisper.py b/test/models/test_whisper.py index aeab692713..8779f21c9b 100644 --- a/test/models/test_whisper.py +++ b/test/models/test_whisper.py @@ -94,12 +94,14 @@ class TestWhisper(unittest.TestCase): self.assertEqual(TRANSCRIPTION_2, transcriptions[0]) self.assertEqual(TRANSCRIPTION_1, transcriptions[1]) + @unittest.skip("file 3 url is broken") @unittest.skipIf(CI or (Device.DEFAULT == "CPU" and CPU_LLVM), "too long for CI") def test_transcribe_long(self): waveform = [load_file_waveform(fetch(TEST_FILE_3_URL))] transcription = transcribe_waveform(self.model, self.enc, waveform) self.assertWER(transcription, TRANSCRIPTION_3, 0.085) + @unittest.skip("file 3 url is broken") @unittest.skipIf(CI or (Device.DEFAULT == "CPU" and CPU_LLVM), "too long for CI") def test_transcribe_long_no_batch(self): waveforms = [load_file_waveform(fetch(TEST_FILE_3_URL)), load_file_waveform(TEST_FILE_1)] diff --git a/test/test_gc.py b/test/test_gc.py index faa25a741f..3f3c8129b7 100644 --- a/test/test_gc.py +++ b/test/test_gc.py @@ -7,13 +7,22 @@ from tinygrad.engine.realize import run_schedule from tinygrad.uop.ops import UOp from tinygrad.tensor import Tensor +def _allocations_of_type(t): + ret = 0 + for x in gc.get_objects(): + try: + if isinstance(x, t): ret += 1 + except ReferenceError: + pass + return ret + def tensors_allocated(): gc.collect() - return sum([isinstance(x, Tensor) for x in gc.get_objects()]) + return _allocations_of_type(Tensor) def bufs_allocated(): gc.collect() - return sum([isinstance(x, Buffer) for x in gc.get_objects()]) + return _allocations_of_type(Buffer) class TestGC(unittest.TestCase):