forked from tinygrad/tinygrad
copy movement op tests construct copies (#17792)
Unit Tests / Models (push) Successful in 1m22s
Unit Tests / Linux (DSP) (push) Successful in 1m51s
Unit Tests / ONNX (CPU) Tests (push) Successful in 1m55s
Unit Tests / Linters (push) Successful in 1m59s
Unit Tests / Test LLM (push) Successful in 2m6s
Unit Tests / Fuzzing (push) Successful in 2m8s
Unit Tests / hcq2 (push) Successful in 2m43s
Unit Tests / Docs (push) Successful in 2m50s
Unit Tests / AMD ASM IDE (push) Successful in 2m47s
Unit Tests / Null Tests (push) Successful in 2m59s
Unit Tests / openpilot Compile Tests (push) Successful in 2m59s
Unit Tests / Torch Backend Training (push) Successful in 3m3s
Unit Tests / Unit Tests (push) Successful in 3m9s
Unit Tests / Python Backend (push) Successful in 3m16s
Unit Tests / Linux (amdllvm gfx1100) (push) Successful in 3m31s
Unit Tests / Linux (amdllvm gfx1201) (push) Successful in 3m31s
Unit Tests / SPEC=2 (2) (push) Successful in 3m39s
Unit Tests / Linux (DEV=CPU:LVP) (push) Successful in 3m36s
Unit Tests / Linux (DEV=CPU:LLVM) (push) Successful in 3m41s
Unit Tests / SPEC=2 (1) (push) Failing after 3m48s
Unit Tests / Compile-only (DEV=NULL:NAK:sm_120) (push) Successful in 1m43s
Unit Tests / Linux (DEV=CL) (push) Successful in 3m51s
Unit Tests / CL IMAGE Tests (push) Successful in 3m53s
Unit Tests / Optimization Tests (push) Successful in 3m53s
Unit Tests / Linux (DEV=WEBGPU) (push) Successful in 3m49s
Unit Tests / Linux (DEV=CPU:X86) (push) Successful in 3m58s
Unit Tests / Linux (am) (push) Successful in 3m59s
Unit Tests / Linux (amd gfx1100) (push) Successful in 4m0s
Unit Tests / Linux (amd gfx1201) (push) Successful in 4m0s
Unit Tests / Linux (DEV=CPU:CLANG) (push) Successful in 4m17s
Unit Tests / Torch Backend Tests (push) Successful in 4m29s
Deploy Docs / deploy (push) Successful in 4m34s
Unit Tests / Compile-only (DEV=NULL:IR3:a630) (push) Successful in 2m35s
Unit Tests / Linux (amdllvm gfx950) (push) Successful in 3m2s
Unit Tests / Linux (ptx) (push) Successful in 3m0s
Unit Tests / Linux (amd gfx950) (push) Successful in 4m12s
Unit Tests / Linux (nv) (push) Successful in 3m47s
Unit Tests / Compile-only (DEV=NULL:QCOMCL:a630) (push) Successful in 3m36s
Autogen / In-tree Autogen (push) Successful in 11m1s
Autogen / In-tree Autogen (macos) (push) Canceled after 0s
Benchmarks / Mac pytest (push) Canceled after 0s
Benchmarks / LLM (DEV=AMD) (push) Canceled after 0s
Benchmarks / LLM (DEV=METAL) (push) Canceled after 0s
Benchmarks / LLM (DEV=NV) (push) Canceled after 0s
Benchmarks / HLB-CIFAR10 (DEV=AMD) (push) Canceled after 0s
Benchmarks / HLB-CIFAR10 (DEV=METAL) (push) Canceled after 0s
Benchmarks / HLB-CIFAR10 (DEV=NV) (push) Canceled after 0s
Benchmarks / MLPerf (AMD) (push) Canceled after 0s
Benchmarks / MLPerf (NV) (push) Canceled after 0s
Benchmarks / Stable Diffusion (DEV=AMD) (push) Canceled after 0s
Benchmarks / Stable Diffusion (DEV=METAL) (push) Canceled after 0s
Benchmarks / Stable Diffusion (DEV=NV) (push) Canceled after 0s
Benchmarks / Multi-GPU Benchmarks (DEV=AMD) (push) Canceled after 0s
Benchmarks / Multi-GPU Benchmarks (DEV=NV) (push) Canceled after 0s
Benchmarks / Tests (DEV=AMD) (push) Canceled after 0s
Benchmarks / Tests (DEV=METAL) (push) Canceled after 0s
Benchmarks / Tests (DEV=NV) (push) Canceled after 0s
Benchmarks / UsbGPU Benchmark (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 dmonitoring (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 dmonitoring (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 policy (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 supercombo (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 vision (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 dmonitoring (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 dmonitoring (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 policy (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 supercombo (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 vision (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / DSP Benchmark (push) Canceled after 0s
Benchmarks / UsbGPU Benchmark (comma) (push) Canceled after 0s
Benchmarks / PCI Driver Benchmark (DEV=AMD) (push) Canceled after 0s
Benchmarks / PCI Driver Benchmark (DEV=NV) (push) Canceled after 0s
Benchmarks / LLVM Speed (push) Canceled after 0s
Platform Tests / MacOS (unit) (push) Canceled after 0s
Platform Tests / MacOS (unit, mock) (push) Canceled after 0s
Platform Tests / MacOS (DEV=METAL) (1) (push) Canceled after 0s
Platform Tests / MacOS (DEV=METAL) (2) (push) Canceled after 0s
Platform Tests / MacOS (DEV=CPU:CLANG) (push) Canceled after 0s
Platform Tests / MacOS (DEV=CPU:LLVM) (push) Canceled after 0s
Platform Tests / MacOS (DEV=CPU:LVP) (push) Canceled after 0s
Platform Tests / MacOS (DEV=WEBGPU) (push) Canceled after 0s
Platform Tests / Windows (DEV=CPU:CLANG) (push) Canceled after 0s
Platform Tests / Windows (DEV=CPU:LLVM) (push) Canceled after 0s
Platform Tests / Windows (DEV=CPU:X86) (push) Canceled after 0s
Platform Tests / Windows (DEV=WEBGPU) (push) Canceled after 0s
Unit Tests / Models (push) Successful in 1m22s
Unit Tests / Linux (DSP) (push) Successful in 1m51s
Unit Tests / ONNX (CPU) Tests (push) Successful in 1m55s
Unit Tests / Linters (push) Successful in 1m59s
Unit Tests / Test LLM (push) Successful in 2m6s
Unit Tests / Fuzzing (push) Successful in 2m8s
Unit Tests / hcq2 (push) Successful in 2m43s
Unit Tests / Docs (push) Successful in 2m50s
Unit Tests / AMD ASM IDE (push) Successful in 2m47s
Unit Tests / Null Tests (push) Successful in 2m59s
Unit Tests / openpilot Compile Tests (push) Successful in 2m59s
Unit Tests / Torch Backend Training (push) Successful in 3m3s
Unit Tests / Unit Tests (push) Successful in 3m9s
Unit Tests / Python Backend (push) Successful in 3m16s
Unit Tests / Linux (amdllvm gfx1100) (push) Successful in 3m31s
Unit Tests / Linux (amdllvm gfx1201) (push) Successful in 3m31s
Unit Tests / SPEC=2 (2) (push) Successful in 3m39s
Unit Tests / Linux (DEV=CPU:LVP) (push) Successful in 3m36s
Unit Tests / Linux (DEV=CPU:LLVM) (push) Successful in 3m41s
Unit Tests / SPEC=2 (1) (push) Failing after 3m48s
Unit Tests / Compile-only (DEV=NULL:NAK:sm_120) (push) Successful in 1m43s
Unit Tests / Linux (DEV=CL) (push) Successful in 3m51s
Unit Tests / CL IMAGE Tests (push) Successful in 3m53s
Unit Tests / Optimization Tests (push) Successful in 3m53s
Unit Tests / Linux (DEV=WEBGPU) (push) Successful in 3m49s
Unit Tests / Linux (DEV=CPU:X86) (push) Successful in 3m58s
Unit Tests / Linux (am) (push) Successful in 3m59s
Unit Tests / Linux (amd gfx1100) (push) Successful in 4m0s
Unit Tests / Linux (amd gfx1201) (push) Successful in 4m0s
Unit Tests / Linux (DEV=CPU:CLANG) (push) Successful in 4m17s
Unit Tests / Torch Backend Tests (push) Successful in 4m29s
Deploy Docs / deploy (push) Successful in 4m34s
Unit Tests / Compile-only (DEV=NULL:IR3:a630) (push) Successful in 2m35s
Unit Tests / Linux (amdllvm gfx950) (push) Successful in 3m2s
Unit Tests / Linux (ptx) (push) Successful in 3m0s
Unit Tests / Linux (amd gfx950) (push) Successful in 4m12s
Unit Tests / Linux (nv) (push) Successful in 3m47s
Unit Tests / Compile-only (DEV=NULL:QCOMCL:a630) (push) Successful in 3m36s
Autogen / In-tree Autogen (push) Successful in 11m1s
Autogen / In-tree Autogen (macos) (push) Canceled after 0s
Benchmarks / Mac pytest (push) Canceled after 0s
Benchmarks / LLM (DEV=AMD) (push) Canceled after 0s
Benchmarks / LLM (DEV=METAL) (push) Canceled after 0s
Benchmarks / LLM (DEV=NV) (push) Canceled after 0s
Benchmarks / HLB-CIFAR10 (DEV=AMD) (push) Canceled after 0s
Benchmarks / HLB-CIFAR10 (DEV=METAL) (push) Canceled after 0s
Benchmarks / HLB-CIFAR10 (DEV=NV) (push) Canceled after 0s
Benchmarks / MLPerf (AMD) (push) Canceled after 0s
Benchmarks / MLPerf (NV) (push) Canceled after 0s
Benchmarks / Stable Diffusion (DEV=AMD) (push) Canceled after 0s
Benchmarks / Stable Diffusion (DEV=METAL) (push) Canceled after 0s
Benchmarks / Stable Diffusion (DEV=NV) (push) Canceled after 0s
Benchmarks / Multi-GPU Benchmarks (DEV=AMD) (push) Canceled after 0s
Benchmarks / Multi-GPU Benchmarks (DEV=NV) (push) Canceled after 0s
Benchmarks / Tests (DEV=AMD) (push) Canceled after 0s
Benchmarks / Tests (DEV=METAL) (push) Canceled after 0s
Benchmarks / Tests (DEV=NV) (push) Canceled after 0s
Benchmarks / UsbGPU Benchmark (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 dmonitoring (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 dmonitoring (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 policy (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 supercombo (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 vision (DEV=QCOM) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 dmonitoring (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 dmonitoring (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 policy (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.2 compile3 supercombo (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / openpilot 0.11.0 compile3 vision (DEV=QCOM:IR3) (push) Canceled after 0s
Benchmarks / DSP Benchmark (push) Canceled after 0s
Benchmarks / UsbGPU Benchmark (comma) (push) Canceled after 0s
Benchmarks / PCI Driver Benchmark (DEV=AMD) (push) Canceled after 0s
Benchmarks / PCI Driver Benchmark (DEV=NV) (push) Canceled after 0s
Benchmarks / LLVM Speed (push) Canceled after 0s
Platform Tests / MacOS (unit) (push) Canceled after 0s
Platform Tests / MacOS (unit, mock) (push) Canceled after 0s
Platform Tests / MacOS (DEV=METAL) (1) (push) Canceled after 0s
Platform Tests / MacOS (DEV=METAL) (2) (push) Canceled after 0s
Platform Tests / MacOS (DEV=CPU:CLANG) (push) Canceled after 0s
Platform Tests / MacOS (DEV=CPU:LLVM) (push) Canceled after 0s
Platform Tests / MacOS (DEV=CPU:LVP) (push) Canceled after 0s
Platform Tests / MacOS (DEV=WEBGPU) (push) Canceled after 0s
Platform Tests / Windows (DEV=CPU:CLANG) (push) Canceled after 0s
Platform Tests / Windows (DEV=CPU:LLVM) (push) Canceled after 0s
Platform Tests / Windows (DEV=CPU:X86) (push) Canceled after 0s
Platform Tests / Windows (DEV=WEBGPU) (push) Canceled after 0s
* copy movement op tests construct copies * hop 3 gpus * assert the amount of bytes moved * work * arange 4, everyone copies 16B first
This commit is contained in:
@@ -379,27 +379,30 @@ class TestCopyFolding(unittest.TestCase):
|
||||
check_schedule(a.clone(), 1, filter_sink=False)
|
||||
|
||||
def test_shrink_copy(self):
|
||||
a = Tensor.arange(4)
|
||||
view = a.shrink(((0, 2),))
|
||||
b = view.clone()
|
||||
run_linear(*check_schedule(b, 1, filter_sink=False))
|
||||
self.assertEqual(b.uop.base.buffer.size, 2)
|
||||
self.assertEqual(b.uop.numel(), 2)
|
||||
self.assertListEqual(b.tolist(), [0, 1])
|
||||
a = Tensor.arange(4).clone("CPU:1").realize()
|
||||
b = a.to("CPU:2").shrink(((1, 3),)).to("CPU:3")
|
||||
GlobalCounters.reset()
|
||||
run_linear(*check_schedule(b, 3, filter_sink=False))
|
||||
# extra E kernel, copy exactly 4 bytes
|
||||
self.assertEqual(GlobalCounters.global_mem, 4*4 + 2*4*2 + 2*4)
|
||||
self.assertListEqual(b.tolist(), [1, 2])
|
||||
|
||||
def test_expanded_copy(self):
|
||||
a = Tensor.arange(2)
|
||||
view = a.reshape(2, 1).expand(2, 2)
|
||||
b = view.clone()
|
||||
run_linear(*check_schedule(b, 1, filter_sink=False))
|
||||
self.assertEqual(b.uop.base.buffer.size, 4)
|
||||
self.assertEqual(b.uop.numel(), 4)
|
||||
self.assertListEqual(b.tolist(), [[0, 0], [1, 1]])
|
||||
a = Tensor.arange(4).clone("CPU:1").realize()
|
||||
b = a.to("CPU:2").reshape(4, 1).expand(4, 2).to("CPU:3")
|
||||
GlobalCounters.reset()
|
||||
run_linear(*check_schedule(b, 3, filter_sink=False))
|
||||
# TODO: expands before copy
|
||||
self.assertEqual(GlobalCounters.global_mem, 4*4 + (4*4 + 8*4) + 8*4)
|
||||
self.assertListEqual(b.tolist(), [[0, 0], [1, 1], [2, 2], [3, 3]])
|
||||
|
||||
def test_permuted_copy(self):
|
||||
a = Tensor.arange(4)
|
||||
b = a.reshape(2, 2).permute(1, 0)
|
||||
b.realize()
|
||||
a = Tensor.arange(4).clone("CPU:1").realize()
|
||||
b = a.to("CPU:2").reshape(2, 2).permute(1, 0).to("CPU:3")
|
||||
GlobalCounters.reset()
|
||||
run_linear(*check_schedule(b, 3, filter_sink=False))
|
||||
# permutes before copy
|
||||
self.assertEqual(GlobalCounters.global_mem, 4*4 + (4*4 + 4*4) + 4*4)
|
||||
self.assertListEqual(b.tolist(), [[0, 2], [1, 3]])
|
||||
|
||||
def test_permute_on_disk(self):
|
||||
|
||||
Reference in New Issue
Block a user