mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
HIP compilation on CI targeting RDNA3 (#2459)
* hip amd compilation * gate the test properly * cleanup unused import * remove superfluous numpy conversion * add SpeedyNet tests (f32 [passes] & f16 [fails]) * make CI verbose (error log from hip compiler) * test the real ops_hip * Merge branch 'tinygrad:master' into ci/hip-compilation * fix CI * cleanup * really fix CI
This commit is contained in:
37
test/test_hip_rdna3.py
Normal file
37
test/test_hip_rdna3.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python
|
||||
import unittest
|
||||
from tinygrad import Tensor, Device
|
||||
from tinygrad.helpers import dtypes
|
||||
from examples.beautiful_mnist import Model as MNIST
|
||||
from examples.hlb_cifar10 import SpeedyResNet
|
||||
|
||||
@unittest.skipIf(Device.DEFAULT != "HIP", reason="testing HIP->rdna3 compilation needs HIP=1")
|
||||
class TestHIPCompilationRDNA(unittest.TestCase):
|
||||
def test_compile_hip_mnist(self):
|
||||
model = MNIST()
|
||||
|
||||
input = Tensor.rand(512,1,28,28)
|
||||
output = model(input)
|
||||
output.numpy()
|
||||
|
||||
def test_compile_hip_speedyresnet(self):
|
||||
W = Tensor.rand(12,3,2,2)
|
||||
model = SpeedyResNet(W)
|
||||
|
||||
input = Tensor.rand(512, 3, 32, 32)
|
||||
output = model(input)
|
||||
output.numpy()
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_compile_hip_speedyresnet_hf(self):
|
||||
Tensor.default_type = dtypes.float16
|
||||
|
||||
W = Tensor.rand(12,3,2,2)
|
||||
model = SpeedyResNet(W)
|
||||
|
||||
input = Tensor.rand(512, 3, 32, 32)
|
||||
output = model(input)
|
||||
output.numpy()
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user