repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_optim.py | tinygrad_repo/test/external/external_test_optim.py | #!/usr/bin/env python
import unittest, math
import numpy as np
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.python.ops import math_ops
from extra.lr_scheduler import LRSchedulerGroup
from tinygrad.tensor import Tensor
from tinygrad.nn.optim import LAMB, LARS, SGD, OptimizerGroup, AdamW
from... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_onnx_runner.py | tinygrad_repo/test/external/external_test_onnx_runner.py | import unittest, onnx, tempfile, pathlib
import numpy as np
from tinygrad import dtypes, Tensor
from tinygrad.uop.ops import Ops
from tinygrad.device import is_dtype_supported
from tinygrad.frontend.onnx import OnnxRunner, OnnxDataType
from hypothesis import given, strategies as st
# copied from test_const_folding.py
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_hsa_driver.py | tinygrad_repo/test/external/external_test_hsa_driver.py | import ctypes, unittest
from tinygrad.helpers import init_c_struct_t
from tinygrad.device import Device, Buffer, BufferXfer
from tinygrad.dtype import dtypes
from tinygrad.runtime.support.hsa import AQLQueue
from tinygrad.runtime.graph.hsa import VirtAQLQueue, HSAGraph
from tinygrad.engine.realize import ExecItem
def ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_gpu_fail_osx.py | tinygrad_repo/test/external/external_gpu_fail_osx.py | # ugh, OS X OpenCL doesn't support half
from tinygrad.runtime.ops_cl import CLDevice, CLProgram, CLCompiler
src = """#pragma OPENCL EXTENSION cl_khr_fp16 : enable
__kernel void max_half(__global half* data0, const __global half* data1) {
int gidx0 = get_group_id(0);
data0[gidx0] = max(data1[gidx0], (half)0.0);
}""... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_mamba.py | tinygrad_repo/test/external/external_test_mamba.py | import unittest
from tinygrad.helpers import CI
from examples.mamba import Mamba, generate
from transformers import AutoTokenizer
PROMPT = 'Why is gravity '
TOKENIZER = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
@unittest.skipIf(CI, "model is slow for CI")
class TestMamba(unittest.TestCase):
def test_... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/verify_kernel.py | tinygrad_repo/test/external/verify_kernel.py | import argparse
from collections import defaultdict
from extra.optimization.helpers import kern_str_to_lin, time_linearizer
from test.external.fuzz_linearizer import compare_linearizer
from tinygrad.helpers import colored
from tinygrad.codegen.opt.kernel import Kernel
# Use this with the LOGKERNS options to verify tha... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/speed_v_theoretical.py | tinygrad_repo/test/external/speed_v_theoretical.py | import unittest
from tinygrad import Tensor, TinyJit, Device
from tinygrad.helpers import Context, DEBUG, GlobalCounters
from tinygrad.nn import Conv2d
from tinygrad.nn.state import get_parameters
class TestKernelSpeed(unittest.TestCase):
def _get_tensor(self, *shape:int):
with Context(BEAM=0, DEBUG=0):
# ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_fast_idiv.py | tinygrad_repo/test/external/fuzz_fast_idiv.py | import random
import z3
from tinygrad import dtypes
from tinygrad.uop.spec import uops_to_z3, z3_cdiv
from tinygrad.uop.ops import UOp
from tinygrad.uop.decompositions import fast_idiv
random.seed(42)
powers_of_two = [2**i for i in range(64)]
if __name__ == "__main__":
for i in range(10_000):
if i % 1000 == 0:
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_opt.py | tinygrad_repo/test/external/external_test_opt.py | #!/usr/bin/env python
import gc, unittest
import numpy as np
import torch
from tinygrad import GlobalCounters, Tensor, Device
from tinygrad.helpers import getenv, Context, RANGEIFY
from tinygrad.nn.state import get_parameters
from tinygrad.engine.realize import capturing
from tinygrad.tensor import _to_np_dtype
class... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/speed_compare_cuda_nv.py | tinygrad_repo/test/external/speed_compare_cuda_nv.py | from tinygrad import Device, dtypes
from tinygrad.helpers import getenv, colorize_float
from extra.optimization.helpers import load_worlds, ast_str_to_lin
from test.external.fuzz_linearizer import get_fuzz_rawbufs
from tinygrad.codegen.opt.heuristic import hand_coded_optimizations
from tinygrad.codegen.opt.search impor... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_whisper_librispeech.py | tinygrad_repo/test/external/external_test_whisper_librispeech.py | import unittest
import torch
import tqdm
import torchaudio
import pathlib
import jiwer
import os
import numpy as np
from whisper.normalizers import EnglishTextNormalizer
from examples.whisper import init_whisper, transcribe_waveform
class TestWhisperLibriSpeech(unittest.TestCase):
# reference WERs determined by runn... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_fuzz_am_interrupts.py | tinygrad_repo/test/external/external_fuzz_am_interrupts.py | import subprocess
import random
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
def run_test(i, full_run=False):
print(f"\rRunning iteration {i}...", end=" ", flush=True)
p = subprocess.Popen(['python3', 'test/test_tiny.py', 'TestTiny.test_plus'], stdout=subprocess.PIPE, stderr=subpro... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_hcq_fuzz_failures.py | tinygrad_repo/test/external/external_test_hcq_fuzz_failures.py | # ruff: noqa: E501
import os
os.environ["VALIDATE_HCQ"]="1"
import unittest, random
import numpy as np
from tinygrad.codegen.opt.kernel import Kernel, KernelOptError
from tinygrad.device import is_dtype_supported
from tinygrad.uop.ops import UOp, Ops
from tinygrad.codegen.opt.search import Opt, OptOps
from tinygrad im... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_onnx_ops.py | tinygrad_repo/test/external/external_test_onnx_ops.py | # inputs, attributes, and outputs for tests are found here:
# https://github.com/onnx/onnx/blob/main/docs/Operators.md
# https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md
from typing import Any
import unittest, onnx, tempfile
from tinygrad import dtypes, Tensor
from tinygrad.frontend.onnx imp... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_graph.py | tinygrad_repo/test/external/fuzz_graph.py | import random, ctypes
import numpy as np
from tinygrad.device import Buffer, Device
from tinygrad.helpers import Context, getenv, from_mv
from tinygrad.dtype import dtypes
from tinygrad.tensor import Tensor, _to_np_dtype
from tinygrad.engine.realize import ExecItem, BufferXfer, get_runner
from tinygrad.engine.jit impor... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_am.py | tinygrad_repo/test/external/external_test_am.py | import unittest
from tinygrad.runtime.support.am.amdev import AMMemoryManager, AMPageTableEntry
from tinygrad.runtime.support.am.ip import AM_GMC
from tinygrad.runtime.support.hcq import MMIOInterface
from tinygrad.runtime.support.memory import PageTableTraverseContext
from tinygrad.runtime.autogen.am import am
from ti... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/speed_compare_cuda_ptx.py | tinygrad_repo/test/external/speed_compare_cuda_ptx.py | import itertools
from tinygrad import Device
from tinygrad.engine.realize import CompiledRunner, get_program
from tinygrad.codegen.opt.heuristic import hand_coded_optimizations
from tinygrad.helpers import getenv, colorize_float
from extra.optimization.helpers import load_worlds, ast_str_to_lin
from tinygrad.codegen.op... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_uop_gc.py | tinygrad_repo/test/external/external_uop_gc.py | import gc
from tinygrad import Tensor, UOp, Device
from tinygrad.shape.shapetracker import views_to_valid_uop
from tinygrad.engine.realize import method_cache, get_program
def uops_allocated(): return sum([isinstance(x, UOp) for x in gc.get_objects()])
def print_uops():
for x in gc.get_objects():
if isinstance(x... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_load_stable_diffusion.py | tinygrad_repo/test/external/external_benchmark_load_stable_diffusion.py | from tinygrad.helpers import fetch, Timing
from tinygrad.device import Device
from tinygrad.nn.state import torch_load, load_state_dict
from examples.stable_diffusion import StableDiffusion
# run "sudo purge" before testing on OS X to avoid the memory cache
if __name__ == "__main__":
fn = fetch('https://huggingface... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_hip_compile.py | tinygrad_repo/test/external/external_benchmark_hip_compile.py | import random, os
from tinygrad.helpers import Timing
from tinygrad.runtime.ops_hip import compile_hip, HIPDevice
from tinygrad.runtime.ops_cl import compile_cl, CLDevice
# OMP_NUM_THREADS=1 strace -tt -f -e trace=file python3 test/external/external_benchmark_hip_compile.py
# AMD_COMGR_REDIRECT_LOGS=stdout AMD_COMGR_E... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_shapetracker_size.py | tinygrad_repo/test/external/fuzz_shapetracker_size.py | from tinygrad.shape.shapetracker import ShapeTracker
from test.external.fuzz_shapetracker import shapetracker_ops as st_ops
from test.unit.test_shapetracker_math import MultiShapeTracker
from tinygrad.helpers import getenv
import random
random.seed(getenv("SEED", 42))
for i in range(getenv("CNT", 2000)):
if getenv("... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_linearizer.py | tinygrad_repo/test/external/fuzz_linearizer.py | import random, traceback, ctypes, argparse, os
from typing import Any
import numpy as np
from collections import defaultdict
from extra.optimization.helpers import load_worlds, ast_str_to_lin, kern_str_to_lin
from tinygrad.engine.realize import get_program
# We need to insert ioctl before opening devices.
if os.getenv... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_mnist_data_select.py | tinygrad_repo/test/external/external_test_mnist_data_select.py | #!/bin/bash
from tinygrad import Tensor
from extra.datasets import fetch_mnist
if __name__ == "__main__":
X_train, Y_train, X_test, Y_test = fetch_mnist(tensors=True)
samples = Tensor.randint(512, high=X_train.shape[0])
select = X_train[samples].realize()
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_hip_compiler_bug.py | tinygrad_repo/test/external/external_hip_compiler_bug.py | # [<buf device:HIP size:1605632 dtype:dtypes.float>, <buf device:HIP size:301506 dtype:dtypes.float>, <buf device:HIP size:9408 dtype:dtypes.float>]
from tinygrad import Device, dtypes
from tinygrad.device import Buffer, CompiledRunner
import ctypes
import gpuctypes.hip as hip
from tinygrad.helpers import to_char_p_p,... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_example.py | tinygrad_repo/test/external/external_test_example.py | import unittest
from tinygrad import Device
from tinygrad.tensor import Tensor
from tinygrad.helpers import getenv, CI
def multidevice_test(fxn):
exclude_devices = getenv("EXCLUDE_DEVICES", "").split(",")
def ret(self):
for device in Device._devices:
if device in ["REMOTE", "DISK", "NPY", "FAKE", "DSP", ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_am.py | tinygrad_repo/test/external/external_benchmark_am.py | from tinygrad.helpers import Profiling
from tinygrad import Device
if __name__ == "__main__":
am = Device["AMD"]
# kfd is 0.55ms!
with Profiling("allocation 127.7mb"):
am.allocator.alloc(int(127.7*1024*1024))
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_llama3_ff.py | tinygrad_repo/test/external/external_test_llama3_ff.py | #!/usr/bin/env python3
from tinygrad import Tensor, TinyJit, nn
from extra.models.llama import FeedForward
if __name__ == "__main__":
model = FeedForward(4096, 14336)
for x in nn.state.get_parameters(model): x.replace(x.half()).realize()
jrun = TinyJit(model)
for i in range(5):
print(f"*** run {i}")
jr... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_metal_compile_fail.py | tinygrad_repo/test/external/external_metal_compile_fail.py | # AssertionError: Error Domain=AGXMetalG15X_B0 Code=3 "Compiler encountered an internal error"
src = """
#include <metal_stdlib>
using namespace metal;
kernel void r_64_32_8_16_4_6_6_4(device float* data0, const device float* data1,
uint3 gid [[threadgroup_position_in_grid]], uint3 lid... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_multi_gpu.py | tinygrad_repo/test/external/external_multi_gpu.py | #!/usr/bin/env python3
# cd extra/disassemblers/ && git clone --recursive github.com:geohot/cuda_ioctl_sniffer.git
# LD_PRELOAD=$PWD/extra/disassemblers/cuda_ioctl_sniffer/out/sniff.so CL=1 python3 test/external/external_multi_gpu.py
import numpy as np
from tinygrad.tensor import Tensor
from tinygrad.helpers import col... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_jit_on_models.py | tinygrad_repo/test/external/external_test_jit_on_models.py | #!/usr/bin/env python
import unittest
import numpy as np
from tinygrad import Tensor, dtypes
from tinygrad.engine.jit import TinyJit
from tinygrad.helpers import CI
from test.helpers import derandomize_model
from examples.llama import Transformer
def helper_test_jitted_correctness(gen, train, train_jit):
nojit = tr... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_onnx_backend.py | tinygrad_repo/test/external/external_test_onnx_backend.py | import unittest
from typing import Any, Tuple
from onnx.backend.base import Backend, BackendRep
import onnx.backend.test
import numpy as np
from tinygrad import Tensor, Device, dtypes
from tinygrad.helpers import getenv, OSX
from tinygrad.device import is_dtype_supported
from tinygrad.frontend.onnx import OnnxRunner
#... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_image.py | tinygrad_repo/test/external/external_test_image.py | #!/usr/bin/env python
import os
import unittest
import numpy as np
if 'IMAGE' not in os.environ:
os.environ['IMAGE'] = '2'
os.environ['CL'] = '1'
os.environ['OPT'] = '2'
from tinygrad.tensor import Tensor
from tinygrad.nn import Conv2d
class TestImage(unittest.TestCase):
def test_create_image(self):
t = Tensor... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_openpilot.py | tinygrad_repo/test/external/external_benchmark_openpilot.py | import time, sys, hashlib
from pathlib import Path
from tinygrad.frontend.onnx import OnnxRunner
from tinygrad import Tensor, dtypes, TinyJit
from tinygrad.helpers import IMAGE, GlobalCounters, fetch, colored, getenv, trange
import numpy as np
from extra.bench_log import BenchEvent, WallTimeEvent
OPENPILOT_MODEL = sys... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_disk_raw.py | tinygrad_repo/test/external/external_benchmark_disk_raw.py | import pathlib
from tinygrad import Tensor, Device, Context
from tinygrad.helpers import getenv
if __name__ == "__main__":
with Context(DEBUG=2):
disk_llama = Tensor(pathlib.Path(getenv("TESTFILE", "/raid/weights/LLaMA-3/8B/consolidated.00.pth")))
device_llama = disk_llama.to(Device.DEFAULT).realize()
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_kfd.py | tinygrad_repo/test/external/fuzz_kfd.py | #!/usr/bin/env python3
import random
from tqdm import trange
from typing import List
from tinygrad import Device
from tinygrad.runtime.ops_amd import AMDDevice, HWQueue
if __name__ == "__main__":
dev: List[AMDDevice] = [Device[f"KFD:{i}"] for i in range(6)]
print(f"got {len(dev)} devices")
buffers = [(rd:=rando... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_losses.py | tinygrad_repo/test/external/external_test_losses.py | from tinygrad import Tensor
from test.external.mlperf_retinanet.focal_loss import sigmoid_focal_loss as ref_sigmoid_focal_loss
from test.external.mlperf_unet3d.dice import DiceCELoss
from examples.mlperf.losses import dice_ce_loss, sigmoid_focal_loss, l1_loss
import numpy as np
import torch
import unittest
class Exte... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_bert_softmax.py | tinygrad_repo/test/external/external_benchmark_bert_softmax.py | from tinygrad import Tensor, dtypes, Context, GlobalCounters
dtypes.default_float = dtypes.float16
from tinygrad.dtype import to_dtype
from tinygrad.helpers import getenv
from test.test_softmax_fusion import single_kernel_softmax
if __name__ == "__main__":
# softmax in bert layers
BS = getenv("BS", 96//6)
acc_dt... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_shape_ops.py | tinygrad_repo/test/external/fuzz_shape_ops.py | from __future__ import annotations
import unittest
from math import prod
from hypothesis import assume, given, settings, strategies as st
from hypothesis.extra import numpy as stn
import numpy as np
import torch
from tinygrad import Tensor
from tinygrad.helpers import CI, getenv
settings.register_profile(__file__, ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_hcq.py | tinygrad_repo/test/external/external_test_hcq.py | import unittest, ctypes, struct, time, array
from tinygrad import Device, Tensor, dtypes
from tinygrad.helpers import to_mv, CI
from tinygrad.device import Buffer, BufferSpec
from tinygrad.engine.realize import get_runner
def _time_queue(q, d):
st = time.perf_counter()
q.signal(d.timeline_signal, d.timeline_value)... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_bert_matmuls.py | tinygrad_repo/test/external/external_benchmark_bert_matmuls.py | from tinygrad import Tensor, dtypes
dtypes.default_float = dtypes.float16
from tinygrad.dtype import to_dtype
from tinygrad.helpers import getenv
if __name__ == "__main__":
# matmuls in bert layers
BS = getenv("BS", 96//6)
acc_dtype = to_dtype(getenv("ACC_DTYPE", "half"))
tensors = [
(Tensor.empty(BS, 512,... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_metrics.py | tinygrad_repo/test/external/external_test_metrics.py | from tinygrad import Tensor
from test.external.mlperf_unet3d.dice import DiceScore
from examples.mlperf.metrics import dice_score, log_perplexity
import numpy as np
import torch
import unittest, math
class ExternalTestMetrics(unittest.TestCase):
def _test_metrics(self, tinygrad_metrics, orig_metrics, pred, label, a... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_fuzz_hcq_signals.py | tinygrad_repo/test/external/external_fuzz_hcq_signals.py | import random
from tinygrad import Device
from tinygrad.helpers import getenv, DEBUG
def main():
seed = getenv("SEED", 1337)
n_gpus = getenv("GPUS", 3)
iters = getenv("ITERS", 10000000)
only_compute = bool(getenv("ONLY_COMPUTE", 0))
print(f"{n_gpus} GPUs for {iters} iterations, {only_compute=}, seed {seed}"... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_schedule.py | tinygrad_repo/test/external/external_benchmark_schedule.py | from extra.models.resnet import ResNet50
from tinygrad import Tensor, nn, Device
from tinygrad.helpers import Profiling, Timing, getenv
from tinygrad.uop.ops import Ops
from tinygrad.codegen import get_rewrites_for_renderer, apply_rewrites, rewrites_for_linearizer
from tinygrad.uop.spec import type_verify
if __name__ ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/graph_batchnorm.py | tinygrad_repo/test/external/graph_batchnorm.py | import unittest
from tinygrad.nn.state import get_parameters
from tinygrad.tensor import Tensor
from tinygrad.nn import Conv2d, BatchNorm2d, optim
def model_step(lm):
with Tensor.train():
x = Tensor.ones(8,12,128,256, requires_grad=False)
optimizer = optim.SGD(get_parameters(lm), lr=0.001)
loss = lm.forw... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_lm_head.py | tinygrad_repo/test/external/external_test_lm_head.py | from tinygrad import Tensor, nn
if __name__ == "__main__":
vocab_size = 50257
n_embd = 768
lm_head = nn.Linear(n_embd, vocab_size, bias=False)
bs = 4
seq_len = 1024
x = Tensor.rand(bs, seq_len, n_embd)
ret = lm_head(x).realize()
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_speed_llama.py | tinygrad_repo/test/external/external_test_speed_llama.py | # NOTE: this only tests the speed of the LLaMA codegen, it doesn't actually run the net
import unittest, time
from examples.llama import Transformer, MODEL_PARAMS
from tinygrad.tensor import Tensor
from tinygrad import Device
from tinygrad.nn.state import get_state_dict
from tinygrad.device import Allocator, Compiled
f... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_resnet.py | tinygrad_repo/test/external/external_benchmark_resnet.py | import functools
import time
import unittest
from tinygrad import Tensor, TinyJit, GlobalCounters, Device
from tinygrad.helpers import getenv, Context
from tinygrad.nn.optim import SGD
from tinygrad.nn.state import get_parameters
from tinygrad.engine.realize import run_schedule
from extra.models import resnet
from ex... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_hip_compile.py | tinygrad_repo/test/external/external_test_hip_compile.py | import time, unittest
from tinygrad.runtime.support.hip_comgr import compile_hip
from tinygrad import Tensor
from tinygrad.device import Device
from tinygrad.engine.schedule import create_schedule
from tinygrad.codegen.opt.kernel import Kernel
class TestHIPCompileSpeed(unittest.TestCase):
@unittest.skipIf(Device.DEF... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_keccak.py | tinygrad_repo/test/external/external_test_keccak.py | import unittest, zipfile, re
from tinygrad import Tensor
from tinygrad.helpers import fetch, tqdm
SHA3_URL = "https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/sha3/sha-3bytetestvectors.zip"
SHAKE_URL = "https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Vali... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_yolov8.py | tinygrad_repo/test/external/external_test_yolov8.py | import numpy as np
from examples.yolov8 import YOLOv8, get_variant_multiples, preprocess, label_predictions, postprocess
from tinygrad import Tensor
import unittest
import io, cv2
import onnxruntime as ort
import ultralytics
from tinygrad.nn.state import safe_load, load_state_dict
from tinygrad.helpers import fetch
cl... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_kernel_launch.py | tinygrad_repo/test/external/external_benchmark_kernel_launch.py | import time
from tinygrad import Tensor, TinyJit, Device, Context
from tinygrad.helpers import Profiling, Timing, GlobalCounters
# python3 test/speed/external_test_speed_v_torch.py TestSpeed.test_add_a
@TinyJit
def plus(a:Tensor, b:Tensor): return a+b
if __name__ == "__main__":
a = Tensor([1]).realize()
b = Tens... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_speed_theoretical.py | tinygrad_repo/test/external/external_test_speed_theoretical.py | import time, unittest
from tinygrad import Tensor, TinyJit, Device, dtypes
from tinygrad.helpers import getenv, GlobalCounters
SZMAX = getenv("SZMAX", 10)
SZMIN = min(SZMAX, getenv("SZMIN", 10))
def _test(tcount, fxn, dtype=dtypes.float):
print(f"**** testing {fxn.__name__} {dtype}")
allgbs = []
for sz in range(... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_fuzz_ampt.py | tinygrad_repo/test/external/external_fuzz_ampt.py | import random
from typing import Optional
from tinygrad.helpers import round_up
from tinygrad.runtime.support.am.amdev import AMPageTableTraverseContext
from test.external.external_test_am import helper_read_entry_components, FakeAM
class AMPTFuzzer:
def __init__(self, total_size):
self.total_size = total_size
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_llama_schedule.py | tinygrad_repo/test/external/external_benchmark_llama_schedule.py | from tinygrad import nn, Tensor, Device, dtypes
from tinygrad.helpers import Timing
from extra.models.llama import Transformer
from examples.llama3 import MODEL_PARAMS
if __name__ == "__main__":
Device.DEFAULT = "NULL"
Tensor.training = True
#model_size = "8B"
model_size = "405B"
with Timing("total "):
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_shapetracker.py | tinygrad_repo/test/external/fuzz_shapetracker.py | import random
from tinygrad.helpers import DEBUG, getenv
from test.unit.test_shapetracker import CheckingShapeTracker
def do_permute(st):
perm = list(range(0, len(st.shape)))
random.shuffle(perm)
perm = tuple(perm)
if DEBUG >= 1: print("st.permute(", perm, ")")
st.permute(perm)
def do_pad(st):
c = random.... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_simple_tokenizer.py | tinygrad_repo/test/external/external_test_simple_tokenizer.py | from transformers import AutoTokenizer
from datasets import load_dataset
from tinygrad.apps.llm import SimpleTokenizer, gpt2_decode_vocab, get_llama_re
from tinygrad.helpers import tqdm, getenv, partition
# use ALLOW_FAILED=-1 to go over the entire dataset without printing.
if __name__ == "__main__":
base_tokenizer ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_tlsf.py | tinygrad_repo/test/external/external_test_tlsf.py | import unittest
from tinygrad.runtime.support.memory import TLSFAllocator
class TestTLSFAllocator(unittest.TestCase):
def setUp(self):
self.allocator = TLSFAllocator(1024, block_size=16)
def test_basic_alloc_free(self):
addr1 = self.allocator.alloc(32)
self.assertEqual(addr1, 0)
addr2 = self.allo... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_nv.py | tinygrad_repo/test/external/external_test_nv.py | import unittest, struct, array, ctypes
from tinygrad import Device, dtypes, Tensor
from tinygrad.helpers import to_mv
from tinygrad.runtime.ops_nv import NVDevice, HWQueue
from tinygrad.codegen.opt.search import Opt, OptOps
from tinygrad.engine.realize import get_runner, CompiledRunner, get_program
from test.external.f... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_model_benchmark.py | tinygrad_repo/test/external/external_model_benchmark.py | import csv, pathlib, time
import numpy as np
import torch
torch.set_num_threads(1)
import onnxruntime as ort
from onnx2torch import convert
from tinygrad.frontend.onnx import OnnxRunner
from tinygrad.helpers import OSX, DEBUG, fetch, getenv
from tinygrad.dtype import _to_np_dtype
from tinygrad import Tensor, Device, dt... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_fuzz_tlsf.py | tinygrad_repo/test/external/external_fuzz_tlsf.py | import random
from typing import Dict, Optional
from tinygrad.helpers import getenv
from tinygrad.runtime.support.memory import TLSFAllocator
class AllocatorFuzzer:
def __init__(self, total_size):
self.total_size = total_size
self.alloc_payload = 0
self.mv = memoryview(bytearray(total_size))
self.all... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_keccak.py | tinygrad_repo/test/external/external_benchmark_keccak.py | from tinygrad import Tensor, dtypes
from tinygrad.engine.jit import TinyJit
from tinygrad.helpers import Timing, getenv
if __name__ == "__main__":
BS = getenv("BS", 2**14)
BLOCKSIZE = getenv("BLOCKSIZE", 4096)
HASHFN = getenv("HASHFN", "shake_128")
NRUNS = getenv("NRUNS", 5)
@TinyJit
def hasher(data: Tens... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_usb_asm24.py | tinygrad_repo/test/external/external_test_usb_asm24.py | import unittest, time
from tinygrad.runtime.support.usb import ASM24Controller
from tinygrad.helpers import Timing
from tinygrad import Tensor, Device
import numpy as np
class TestASMController(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.ctrl = ASM24Controller()
def test_write_and_read(self):
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_jit_failure.py | tinygrad_repo/test/external/external_jit_failure.py | from tinygrad import Tensor, TinyJit, Device
import numpy as np
GPUS = 4
N = 128
ds = tuple([Device.canonicalize(f"{Device.DEFAULT}:{i}") for i in range(GPUS)])
t = Tensor.rand(N, N, N).shard(ds, 0)
n = t.numpy()
@TinyJit
def allreduce(t:Tensor) -> Tensor:
return t.sum(0) #.realize()
for i in range(10):
print(i)... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_sdxl_softmax.py | tinygrad_repo/test/external/external_benchmark_sdxl_softmax.py | from tinygrad import Tensor, dtypes, GlobalCounters
from tinygrad.engine.realize import get_program
if __name__ == "__main__":
t = Tensor.empty(81920, 4096, dtype=dtypes.half)
GlobalCounters.reset()
t.softmax(-1, dtype="half").realize()
GlobalCounters.reset()
t.softmax(-1, dtype="half", _single_kernel=True).... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_test_datasets.py | tinygrad_repo/test/external/external_test_datasets.py | from extra.datasets.kits19 import iterate, preprocess
from examples.mlperf.dataloader import batch_load_unet3d, batch_load_retinanet
from test.external.mlperf_retinanet.coco_utils import get_openimages
from test.external.mlperf_retinanet.openimages import postprocess_targets
from test.external.mlperf_retinanet.presets ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/external_benchmark_multitensor_allreduce.py | tinygrad_repo/test/external/external_benchmark_multitensor_allreduce.py | from tinygrad import Tensor, Device, GlobalCounters, TinyJit, dtypes
from tinygrad.helpers import getenv, Context, RING, DEBUG
def test(devs: list[str], N: int, iters:int = 10):
@TinyJit
def f(t: Tensor) -> Tensor: t.sum(0).realize()
secs, gflops, gbs = 0, 0, 0
for i in range(-3, iters):
t = Tensor.empty(... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/fuzz_symbolic.py | tinygrad_repo/test/external/fuzz_symbolic.py | import random, operator
import z3
from tinygrad import Variable, dtypes
from tinygrad.uop.ops import UOp
from tinygrad.uop.spec import uops_to_z3
from tinygrad.helpers import DEBUG, Context
seed = random.randint(0, 100)
print(f"Seed: {seed}")
random.seed(seed)
unary_ops = [lambda a:a+random.randint(-4, 4), lambda a: ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_unet3d/dice.py | tinygrad_repo/test/external/mlperf_unet3d/dice.py | # https://github.com/mlcommons/training/blob/master/image_segmentation/pytorch/model/losses.py
import torch
import torch.nn as nn
import torch.nn.functional as F
class Dice:
def __init__(self,
to_onehot_y: bool = True,
to_onehot_x: bool = False,
use_softmax: bool = True... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_unet3d/kits19.py | tinygrad_repo/test/external/mlperf_unet3d/kits19.py | # copied from https://github.com/mlcommons/training/blob/5c08ce57e7f582cc4558035d8324a2bf4c8ca225/image_segmentation/pytorch/data_loading/pytorch_loader.py
import random
import numpy as np
import scipy.ndimage
from torch.utils.data import Dataset
from torchvision import transforms
def get_train_transforms():
ran... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_bert/external_benchmark_bert.py | tinygrad_repo/test/external/mlperf_bert/external_benchmark_bert.py | import unittest, time
from tinygrad import Tensor, TinyJit, GlobalCounters, Device
from tinygrad.helpers import getenv, Context
from tinygrad.nn.optim import LAMB
from tinygrad.nn.state import get_parameters
from tinygrad.engine.realize import run_schedule
from extra.models import bert
bs = getenv("BS", 16)
seq_len ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_bert/external_test_checkpoint_loading.py | tinygrad_repo/test/external/mlperf_bert/external_test_checkpoint_loading.py | # Test whether pretrained weights from first BERT pretraining phase have been loaded correctly
# Usage:
# 1. Download the BERT checkoints with `wikipedia_download.py`
# Command: BASEDIR=/path/to/wiki python3 wikipedia_download.py
# 2. Run this script. (Adjust EVAL_BS and GPUS as needed)
# Command: EVAL_BEAM=4 DEF... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_bert/preprocessing/create_pretraining_data.py | tinygrad_repo/test/external/mlperf_bert/preprocessing/create_pretraining_data.py | # https://github.com/mlcommons/training/blob/1c8a098ae3e70962a4f7422c0b0bd35ae639e357/language_model/tensorflow/bert/cleanup_scripts/create_pretraining_data.py
# NOTE: This is a direct copy of the original script
# NOTE: With python 3.7.12, pip install tensorflow=1.15.5
"""Create masked LM/next sentence masked_lm TF ex... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_bert/preprocessing/tokenization.py | tinygrad_repo/test/external/mlperf_bert/preprocessing/tokenization.py | # https://github.com/mlcommons/training/blob/1c8a098ae3e70962a4f7422c0b0bd35ae639e357/language_model/tensorflow/bert/cleanup_scripts/tokenization.py
# NOTE: This is a direct copy of the original script
"""Tokenization classes."""
from __future__ import absolute_import
from __future__ import division
from __future__ im... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_bert/preprocessing/external_test_preprocessing_part.py | tinygrad_repo/test/external/mlperf_bert/preprocessing/external_test_preprocessing_part.py | # USAGE:
# 1. Download raw text data with `wikipedia_download.py`
# 2. Install python==3.7.12 and tensorflow==1.15.5
# Run `create_pretraining_data.py` to create TFRecords on specific part (This will take some time)
# Command: python3 create_pretraining_data.py --input_file=/path/to/part-00XXX-of-00500 --voc... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_bert/preprocessing/pick_eval_samples.py | tinygrad_repo/test/external/mlperf_bert/preprocessing/pick_eval_samples.py | # https://github.com/mlcommons/training/blob/1c8a098ae3e70962a4f7422c0b0bd35ae639e357/language_model/tensorflow/bert/cleanup_scripts/pick_eval_samples.py
# NOTE: This is a direct copy of the original script
"""Script for picking certain number of sampels.
"""
import argparse
import time
import logging
import collectio... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/process_replay/reset.py | tinygrad_repo/test/external/process_replay/reset.py | #!/usr/bin/env python3
from tinygrad.helpers import db_connection, VERSION
cur = db_connection()
cur.execute(f"drop table if exists process_replay_{VERSION}")
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/process_replay/process_replay.py | tinygrad_repo/test/external/process_replay/process_replay.py | #!/usr/bin/env python3
# compare kernels created by HEAD against master
import os, multiprocessing, logging, pickle, sqlite3, difflib, warnings, itertools, functools, base64, codecs
from dataclasses import replace
from typing import Callable, Any
ASSERT_DIFF = int((flag:="[pr]") in os.getenv("COMMIT_MESSAGE", flag) or... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_resnet/lars_optimizer.py | tinygrad_repo/test/external/mlperf_resnet/lars_optimizer.py | # https://github.com/mlcommons/training/blob/e3769c8dcf88cd21e1001dd2f894b40a1513ec5d/image_classification/tensorflow2/lars_optimizer.py
# changes: don't call lr_t if it's not a schedule
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_resnet/lars_util.py | tinygrad_repo/test/external/mlperf_resnet/lars_util.py | # https://github.com/mlcommons/training/blob/e237206991d10449d9675d95606459a3cb6c21ad/image_classification/tensorflow2/lars_util.py
# changes: commented out logging
# changes: convert_to_tensor_v2 -> convert_to_tensor
# changes: extend from tf.python.keras.optimizer_v2.learning_rate_schedule.LearningRateScheduler
# Co... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/presets.py | tinygrad_repo/test/external/mlperf_retinanet/presets.py | # Copied from https://github.com/mlcommons/training/blob/637c82f9e699cd6caf108f92efb2c1d446b630e0/single_stage_detector/ssd/presets.py
from test.external.mlperf_retinanet import transforms as T
class DetectionPresetTrain:
def __init__(self, data_augmentation, hflip_prob=0.5, mean=(123., 117., 104.)):
if d... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/coco_utils.py | tinygrad_repo/test/external/mlperf_retinanet/coco_utils.py | # Copied from https://github.com/mlcommons/training/blob/637c82f9e699cd6caf108f92efb2c1d446b630e0/single_stage_detector/ssd/coco_utils.py
import os
import torch
import torchvision
from test.external.mlperf_retinanet import transforms as T
class ConvertCocoPolysToMask(object):
def __init__(self, filter_iscrowd=Tr... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/focal_loss.py | tinygrad_repo/test/external/mlperf_retinanet/focal_loss.py | # Copied from https://github.com/mlcommons/training/blob/cdd928d4596c142c15a7d86b2eeadbac718c8da2/single_stage_detector/ssd/model/focal_loss.py
import torch
import torch.nn.functional as F
def sigmoid_focal_loss(
inputs: torch.Tensor,
targets: torch.Tensor,
alpha: float = 0.25,
gamma: float = 2,
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/openimages.py | tinygrad_repo/test/external/mlperf_retinanet/openimages.py | from test.external.mlperf_retinanet.model.boxes import box_iou
from test.external.mlperf_retinanet.model.utils import Matcher
import torch
# This applies the filtering in https://github.com/mlcommons/training/blob/cdd928d4596c142c15a7d86b2eeadbac718c8da2/single_stage_detector/ssd/model/retinanet.py#L117
# and https:/... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/transforms.py | tinygrad_repo/test/external/mlperf_retinanet/transforms.py | # Copied from https://github.com/mlcommons/training/blob/637c82f9e699cd6caf108f92efb2c1d446b630e0/single_stage_detector/ssd/transforms.py
import torch
import torchvision
from torch import nn, Tensor
from torchvision.transforms import functional as F
from torchvision.transforms import transforms as T
from typing impor... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/model/transform.py | tinygrad_repo/test/external/mlperf_retinanet/model/transform.py | # Copied from https://github.com/mlcommons/training/blob/637c82f9e699cd6caf108f92efb2c1d446b630e0/single_stage_detector/ssd/model/transform.py
import torch
from torch import nn, Tensor
from typing import List, Tuple, Dict, Optional
from test.external.mlperf_retinanet.model.image_list import ImageList
@torch.jit.unu... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/model/utils.py | tinygrad_repo/test/external/mlperf_retinanet/model/utils.py | # Copied from https://github.com/mlcommons/training/blob/637c82f9e699cd6caf108f92efb2c1d446b630e0/single_stage_detector/ssd/model/utils.py
import torch
class Matcher(object):
"""
This class assigns to each predicted "element" (e.g., a box) a ground-truth
element. Each predicted element will have exactly z... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/model/boxes.py | tinygrad_repo/test/external/mlperf_retinanet/model/boxes.py | # Copied from https://github.com/mlcommons/training/blob/637c82f9e699cd6caf108f92efb2c1d446b630e0/single_stage_detector/ssd/model/boxes.py
import torch
from torch import Tensor
from typing import Tuple
def _upcast(t: Tensor) -> Tensor:
# Protects from numerical overflows in multiplications by upcasting to the equ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/mlperf_retinanet/model/image_list.py | tinygrad_repo/test/external/mlperf_retinanet/model/image_list.py | # Copied from https://github.com/mlcommons/training/blob/637c82f9e699cd6caf108f92efb2c1d446b630e0/single_stage_detector/ssd/model/image_list.py
import torch
from torch import Tensor
from typing import List, Tuple
class ImageList(object):
"""
Structure that holds a list of images (of possibly
varying size... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/external/sglang_llama/external_llama_eval.py | tinygrad_repo/test/external/sglang_llama/external_llama_eval.py | from lm_eval import simple_evaluate
from lm_eval.api.instance import Instance
from lm_eval.api.model import LM
from lm_eval.tasks import TaskManager
from pathlib import Path
import json, argparse
from examples.llama3 import build_transformer, Tokenizer, MODEL_PARAMS
from tinygrad import Tensor, Device
from tinygrad.he... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/gpu.py | tinygrad_repo/test/mockgpu/gpu.py | class VirtGPU:
def __init__(self, gpuid): self.gpuid = gpuid
def map_range(self, vaddr, size): raise NotImplementedError()
def unmap_range(self, vaddr, size): raise NotImplementedError()
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/driver.py | tinygrad_repo/test/mockgpu/driver.py | from typing import Any
from dataclasses import dataclass
class VirtFileDesc:
def __init__(self, fd): self.fd, self.off = fd, 0
def ioctl(self, fd, req, argp): raise NotImplementedError()
def mmap(self, st, sz, prot, flags, fd, off): raise NotImplementedError()
def close(self, fd): return 0
class TextFileDesc(... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/helpers.py | tinygrad_repo/test/mockgpu/helpers.py | import ctypes, ctypes.util
def _try_dlopen_gpuocelot():
GPUOCELOT_PATHS = [ctypes.util.find_library("gpuocelot")] if ctypes.util.find_library("gpuocelot") is not None else []
GPUOCELOT_PATHS += ["libgpuocelot.so", "/usr/local/lib/libgpuocelot.so",
"libgpuocelot.dylib", "/usr/local/lib/libgpuo... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/usb.py | tinygrad_repo/test/mockgpu/usb.py | class MockUSB:
def __init__(self, mem):
self.mem = mem
def read(self, address, size):
return bytes(self.mem[address:address+size])
def write(self, address, data, ignore_cache=False):
self.mem[address:address+len(data)] = data
def pcie_mem_req(self, address, value=None, size=1):
if value is No... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/mockgpu.py | tinygrad_repo/test/mockgpu/mockgpu.py | import ctypes, ctypes.util, time, os, builtins, fcntl
from tinygrad.runtime.support.hcq import FileIOInterface
from test.mockgpu.nv.nvdriver import NVDriver
from test.mockgpu.amd.amddriver import AMDDriver
start = time.perf_counter()
# *** ioctl lib ***
libc = ctypes.CDLL(ctypes.util.find_library("c"))
libc.mmap.argty... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/amd/amdgpu.py | tinygrad_repo/test/mockgpu/amd/amdgpu.py | import ctypes, time
from test.mockgpu.gpu import VirtGPU
from test.mockgpu.helpers import _try_dlopen_remu
from tinygrad.helpers import getbits, to_mv, init_c_struct_t
import tinygrad.runtime.autogen.amd_gpu as amd_gpu, tinygrad.runtime.autogen.am.pm4_nv as pm4
SDMA_MAX_COPY_SIZE = 0x400000
regCOMPUTE_PGM_LO = 0x1bac... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/amd/amddriver.py | tinygrad_repo/test/mockgpu/amd/amddriver.py | import pathlib, re, ctypes, mmap, collections, functools, copy, os
import tinygrad.runtime.autogen.kfd as kfd
import tinygrad.runtime.autogen.am.am as am
from tinygrad.helpers import from_mv
from test.mockgpu.driver import VirtDriver, VirtFileDesc, TextFileDesc, DirFileDesc, VirtFile
from test.mockgpu.amd.amdgpu import... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/nv/nvgpu.py | tinygrad_repo/test/mockgpu/nv/nvgpu.py | import ctypes, ctypes.util, time
import tinygrad.runtime.autogen.nv_gpu as nv_gpu
from enum import Enum, auto
from test.mockgpu.gpu import VirtGPU
from test.mockgpu.helpers import _try_dlopen_gpuocelot
from tinygrad.helpers import to_mv, init_c_struct_t
def make_qmd_struct_type():
fields = []
bits = [(name,dt) for... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/nv/nvdriver.py | tinygrad_repo/test/mockgpu/nv/nvdriver.py | import ctypes, mmap, collections, functools, os
import tinygrad.runtime.autogen.nv_gpu as nv_gpu
from typing import Any
from tinygrad.helpers import to_mv
from test.mockgpu.driver import VirtDriver, VirtFileDesc, VirtFile
from test.mockgpu.nv.nvgpu import NVGPU
MAP_FIXED = 0x10
libc = ctypes.CDLL(ctypes.util.find_libr... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/mockgpu/cuda/cuda.py | tinygrad_repo/test/mockgpu/cuda/cuda.py | from __future__ import annotations
from typing import Any
import ctypes, time
from tinygrad.runtime.autogen import cuda as orig_cuda
from test.mockgpu.helpers import _try_dlopen_gpuocelot
from tinygrad.helpers import mv_address
for attr in dir(orig_cuda):
if not attr.startswith('__'):
globals()[attr] = getattr(o... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/test/unit/test_dtype_spec.py | tinygrad_repo/test/unit/test_dtype_spec.py | import unittest, math, operator, subprocess, struct
from tinygrad.tensor import Tensor, dtypes, Device
from tinygrad.dtype import DType, DTYPES_DICT, truncate, float_to_fp16, float_to_bf16, _to_np_dtype, least_upper_dtype, least_upper_float
from tinygrad.device import is_dtype_supported
from tinygrad.helpers import get... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.