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/tinygrad/codegen/quantize.py
tinygrad_repo/tinygrad/codegen/quantize.py
from tinygrad.dtype import dtypes, least_upper_dtype from tinygrad.uop.ops import UOp, Ops, PatternMatcher, UPat from tinygrad.uop.symbolic import symbolic # **** this is the "quantization preprocessor", it makes ONNX quantized models, and probably also others, actually use ints **** # this is badly tested and low qua...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/simplify.py
tinygrad_repo/tinygrad/codegen/simplify.py
from tinygrad.uop.ops import UOp, PatternMatcher, UPat, Ops, graph_rewrite, _substitute, range_start from tinygrad.uop.symbolic import symbolic_flat, sym from tinygrad.helpers import partition from tinygrad.dtype import dtypes def flatten_range(r:UOp): off = range_start[r.op] rngs = r.src[off:] if not len(rngs):...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/lowerer.py
tinygrad_repo/tinygrad/codegen/lowerer.py
# the job of the lowerer is to do indexing from dataclasses import dataclass from tinygrad.uop.ops import KernelInfo, UOp, Ops, PatternMatcher, UPat, sint_to_uop, AxisType, graph_rewrite, resolve # ***** indexing ***** @dataclass class IndexContext: axis_types: tuple[AxisType, ...] idxs: list[UOp] start: int = ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/__init__.py
tinygrad_repo/tinygrad/codegen/__init__.py
from typing import Any, Callable import functools from dataclasses import dataclass from tinygrad.helpers import QUANTIZE, DEVECTORIZE, TRANSCENDENTAL from tinygrad.uop.ops import PatternMatcher, graph_rewrite, UOp, pm_lower_index_dtype from tinygrad.uop.spec import type_verify from tinygrad.renderer import Renderer #...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/gpudims.py
tinygrad_repo/tinygrad/codegen/gpudims.py
import math from tinygrad.uop.ops import UOp, Ops, sint, PatternMatcher, UPat, KernelInfo, ssimplify, AxisType, sint_to_uop from tinygrad.helpers import all_int, dedup from tinygrad.dtype import dtypes from tinygrad.shape.view import get_contraction from tinygrad.renderer import Renderer def _group_dims(dims:tuple[sin...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/late/expander.py
tinygrad_repo/tinygrad/codegen/late/expander.py
# this converts a lowerer program into a vectorized program import functools, itertools, operator from tinygrad.dtype import dtypes, PtrDType, AddrSpace from tinygrad.helpers import AMX, dedup, flatten, all_same, prod, partition from tinygrad.uop.ops import UOp, Ops, UPat, PatternMatcher, GroupOp, AxisType, range_start...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/late/devectorizer.py
tinygrad_repo/tinygrad/codegen/late/devectorizer.py
from typing import Any, cast import functools, operator, itertools from collections import defaultdict from dataclasses import dataclass from tinygrad.dtype import dtypes, ImageDType, DType, AddrSpace, Invalid from tinygrad.uop.ops import UOp, Ops, UPat, PatternMatcher, graph_rewrite, GroupOp, identity_element from tin...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/late/linearize.py
tinygrad_repo/tinygrad/codegen/late/linearize.py
from __future__ import annotations import heapq from collections import defaultdict from dataclasses import dataclass, replace from tinygrad.uop.ops import UOp, Ops, PatternMatcher, UPat, GroupOp, BottomUpGate from tinygrad.helpers import dedup, all_same, flatten, BLOCK_REORDER # NOTE: any toposort should be valid her...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/opt/search.py
tinygrad_repo/tinygrad/codegen/opt/search.py
from typing import cast import functools, math, time, multiprocessing, traceback, signal, atexit from dataclasses import replace from tinygrad.uop.ops import sym_infer, AxisType, pyrender from tinygrad.device import Device, Buffer, Compiler from tinygrad.helpers import prod, flatten, DEBUG, CACHELEVEL, diskcache_get, d...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/opt/swizzler.py
tinygrad_repo/tinygrad/codegen/opt/swizzler.py
from tinygrad.uop.ops import UOp, Ops, GroupOp, PatternMatcher, UPat, graph_rewrite, resolve, sint from tinygrad.helpers import all_same, prod, unwrap, colored from tinygrad.shape.shapetracker import ShapeTracker from tinygrad.shape.view import View, strides_for_shape, get_contraction_with_reduce from tinygrad.schedule...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/opt/tc.py
tinygrad_repo/tinygrad/codegen/opt/tc.py
import math, functools from dataclasses import dataclass from tinygrad.dtype import DType, dtypes from tinygrad.helpers import getenv @dataclass(frozen=True) class TensorCore: # D = A * B + C, A is (M x K), B is (K x N), C and D are (M x N) dims: tuple[int,int,int] # N, M, K threads: int # number of threads that c...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/opt/postrange.py
tinygrad_repo/tinygrad/codegen/opt/postrange.py
from __future__ import annotations import math, itertools from collections import defaultdict from typing import cast, Final from tinygrad.uop.ops import PatternMatcher, UPat, Ops, UOp, KernelInfo, graph_rewrite, AxisType, ssimplify, can_pad, GroupOp from tinygrad.device import Buffer from tinygrad.dtype import AddrSpa...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/opt/__init__.py
tinygrad_repo/tinygrad/codegen/opt/__init__.py
# opt opinionatedly transforms an ast into an optimized ast using either heuristics or beam search from __future__ import annotations from enum import Enum, auto from dataclasses import dataclass from tinygrad.uop.ops import AxisType class OptOps(Enum): TC = auto(); UPCAST = auto(); UNROLL = auto(); LOCAL = auto(); ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/codegen/opt/heuristic.py
tinygrad_repo/tinygrad/codegen/opt/heuristic.py
import itertools from tinygrad.codegen.opt import Opt, OptOps, KernelOptError from tinygrad.helpers import getenv, DEBUG, prod, NOLOCALS, TC_OPT, TC_SELECT, USE_TC, AMX from tinygrad.dtype import ImageDType from tinygrad.uop.ops import Ops, resolve, AxisType from tinygrad.codegen.opt.postrange import Scheduler def han...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/viz/serve.py
tinygrad_repo/tinygrad/viz/serve.py
#!/usr/bin/env python3 import multiprocessing, pickle, difflib, os, threading, json, time, sys, webbrowser, socket, argparse, socketserver, functools, codecs, io, struct import subprocess, ctypes, pathlib from contextlib import redirect_stdout from decimal import Decimal from http.server import BaseHTTPRequestHandler f...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_cl.py
tinygrad_repo/tinygrad/runtime/ops_cl.py
from __future__ import annotations from typing import cast import ctypes, functools, hashlib from tinygrad.runtime.autogen import opencl as cl from tinygrad.helpers import init_c_var, to_char_p_p, from_mv, OSX, DEBUG, mv_address, suppress_finalizing from tinygrad.renderer.cstyle import OpenCLRenderer, IntelRenderer fro...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_cuda.py
tinygrad_repo/tinygrad/runtime/ops_cuda.py
from __future__ import annotations import ctypes, ctypes.util, functools from tinygrad.helpers import DEBUG, getenv, mv_address, init_c_var, init_c_struct_t, suppress_finalizing from tinygrad.device import Compiled, BufferSpec, LRUAllocator, CompilerPairT from tinygrad.renderer.cstyle import CUDARenderer from tinygrad....
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_dsp.py
tinygrad_repo/tinygrad/runtime/ops_dsp.py
from __future__ import annotations import ctypes, os, mmap, tempfile, pathlib, array, functools, threading, contextlib, sys, subprocess, struct assert sys.platform != 'win32' from tinygrad.device import BufferSpec, Compiled, Allocator, Compiler from tinygrad.runtime.ops_cpu import CPUAllocator from tinygrad.dtype impor...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_remote.py
tinygrad_repo/tinygrad/runtime/ops_remote.py
# the REMOTE=1 device is a process boundary between the frontend/runtime # normally tinygrad is frontend <-> middleware <-> runtime <-> hardware # with REMOTE tinygrad is frontend <-> middleware <-> RemoteDevice ///HTTP/// remote_server <-> runtime <-> hardware # this client and server can be on the same machine, s...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_webgpu.py
tinygrad_repo/tinygrad/runtime/ops_webgpu.py
import functools, struct from tinygrad.device import Compiled, Allocator, Compiler, BufferSpec from tinygrad.renderer.wgsl import WGSLRenderer from tinygrad.helpers import round_up, suppress_finalizing from tinygrad.runtime.autogen import webgpu from typing import List, Any, TypeAlias import ctypes import os WGPUDevP...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_qcom.py
tinygrad_repo/tinygrad/runtime/ops_qcom.py
from __future__ import annotations import os, ctypes, functools, mmap, struct, array, math, sys, weakref assert sys.platform != 'win32' from types import SimpleNamespace from typing import Any, cast from tinygrad.device import BufferSpec from tinygrad.runtime.support.hcq import HCQBuffer, HWQueue, HCQProgram, HCQCompil...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_metal.py
tinygrad_repo/tinygrad/runtime/ops_metal.py
import subprocess, pathlib, struct, ctypes, tempfile, functools, contextlib, decimal, platform from typing import Any, cast from tinygrad.helpers import prod, to_mv, getenv, round_up, cache_dir, T, init_c_struct_t, PROFILE, ProfileRangeEvent, cpu_profile, unwrap from tinygrad.device import Compiled, Compiler, CompileEr...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_npy.py
tinygrad_repo/tinygrad/runtime/ops_npy.py
import numpy as np from tinygrad.helpers import flat_mv from tinygrad.device import Compiled, Allocator class NpyAllocator(Allocator['NpyDevice']): def _alloc(self, size:int, options=None) -> np.ndarray: return np.empty(size, dtype=np.uint8) def _as_buffer(self, src:np.ndarray) -> memoryview: return flat_mv(np.req...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_disk.py
tinygrad_repo/tinygrad/runtime/ops_disk.py
import os, sys, mmap, io, ctypes, contextlib, pathlib from typing import Generator, Callable from tinygrad.helpers import OSX, round_up from tinygrad.device import Compiled, Allocator with contextlib.suppress(ImportError): import _posixshmem from tinygrad.runtime.autogen import io_uring, libc class DiskDevice(Comp...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_nv.py
tinygrad_repo/tinygrad/runtime/ops_nv.py
from __future__ import annotations import os, ctypes, contextlib, re, functools, mmap, struct, array, sys, weakref assert sys.platform != 'win32' from typing import cast, ClassVar from dataclasses import dataclass from tinygrad.runtime.support.hcq import HCQCompiled, HCQAllocator, HCQBuffer, HWQueue, CLikeArgsState, HC...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_cpu.py
tinygrad_repo/tinygrad/runtime/ops_cpu.py
from __future__ import annotations import platform, sys, ctypes, functools, time, mmap, threading, queue from tinygrad.helpers import from_mv, to_mv, OSX, WIN, mv_address, wait_cond, cpu_profile, suppress_finalizing, unwrap from tinygrad.device import BufferSpec, DMACPURef from tinygrad.runtime.support.hcq import HCQCo...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_null.py
tinygrad_repo/tinygrad/runtime/ops_null.py
import functools from tinygrad.device import Compiled, Compiler, Allocator from tinygrad.engine.jit import MultiGraphRunner from tinygrad.renderer.cstyle import CStyleLanguage from tinygrad.uop.ops import Ops from tinygrad.helpers import cpu_profile class NullRenderer(CStyleLanguage): device = "NULL" has_local = F...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_hip.py
tinygrad_repo/tinygrad/runtime/ops_hip.py
import ctypes, functools from tinygrad.helpers import init_c_var, mv_address, init_c_struct_t, getenv from tinygrad.device import Compiled, LRUAllocator, BufferSpec from tinygrad.runtime.autogen import hip from tinygrad.runtime.support.compiler_amd import HIPCompiler from tinygrad.renderer.cstyle import HIPRenderer if ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_python.py
tinygrad_repo/tinygrad/runtime/ops_python.py
# pylint: disable=cell-var-from-loop # a python uops emulator # works to test the tensor cores, and all the uops in general # this is the (living) definition of uops from typing import Any, TYPE_CHECKING, cast import pickle, base64, itertools, time, struct, sys from tinygrad.dtype import DType, dtypes, ImageDType, PtrD...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/__init__.py
tinygrad_repo/tinygrad/runtime/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/ops_amd.py
tinygrad_repo/tinygrad/runtime/ops_amd.py
from __future__ import annotations from typing import cast, ClassVar import os, ctypes, ctypes.util, struct, hashlib, functools, importlib, mmap, errno, array, contextlib, sys, weakref assert sys.platform != 'win32' from dataclasses import dataclass from tinygrad.runtime.support.hcq import HCQCompiled, HCQAllocator, HC...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/llvm.py
tinygrad_repo/tinygrad/runtime/support/llvm.py
import ctypes, ctypes.util, os, sys, subprocess from tinygrad.helpers import DEBUG, OSX, getenv if sys.platform == 'win32': # Windows llvm distribution doesn't seem to add itself to PATH or anywhere else where it can be easily retrieved from. # winget also doesn't have something like `brew --prefix llvm` so just h...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/memory.py
tinygrad_repo/tinygrad/runtime/support/memory.py
import collections, functools, dataclasses from typing import Any, ClassVar from tinygrad.helpers import round_up, getenv class TLSFAllocator: """ The allocator is based on the Two-Level Segregated Fit (TLSF) algorithm. The allocator maintains 2 level of buckets: * 1st level is determined by the most significa...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/compiler_cuda.py
tinygrad_repo/tinygrad/runtime/support/compiler_cuda.py
import subprocess, hashlib, tempfile, ctypes, ctypes.util, re, pathlib from typing import Callable from tinygrad.helpers import to_char_p_p, colored, init_c_var, getenv import tinygrad.runtime.autogen.nvrtc as nvrtc from tinygrad.device import Compiler, CompileError CUDA_PATH = getenv("CUDA_PATH", "") def _get_bytes(...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/compiler_cpu.py
tinygrad_repo/tinygrad/runtime/support/compiler_cpu.py
import ctypes, platform, sys, subprocess from tinygrad.device import Compiler from tinygrad.helpers import OSX, getenv, capstone_flatdump, DEBUG from tinygrad.runtime.support.elf import jit_loader try: import tinygrad.runtime.autogen.llvm as llvm except (ImportError, FileNotFoundError): llvm = None #type:ignore[assignm...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/system.py
tinygrad_repo/tinygrad/runtime/support/system.py
import os, mmap, array, functools, ctypes, select, contextlib, dataclasses, sys, errno from typing import cast, ClassVar from tinygrad.helpers import round_up, to_mv, getenv, OSX, temp from tinygrad.runtime.autogen import libc, vfio from tinygrad.runtime.support.hcq import FileIOInterface, MMIOInterface, HCQBuffer from...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/elf.py
tinygrad_repo/tinygrad/runtime/support/elf.py
import struct from dataclasses import dataclass from tinygrad.helpers import getbits, i2u import tinygrad.runtime.autogen.libc as libc @dataclass(frozen=True) class ElfSection: name:str; header:libc.Elf64_Shdr; content:bytes # noqa: E702 def elf_loader(blob:bytes, force_section_align:int=1) -> tuple[memoryview, list[...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/hcq.py
tinygrad_repo/tinygrad/runtime/support/hcq.py
from __future__ import annotations from typing import cast, Callable, Type, TypeVar, Generic, Any, Sequence import contextlib, decimal, statistics, time, ctypes, array, os, struct, traceback, collections try: import fcntl # windows misses that except ImportError: fcntl = None #type:ignore[assignment] from tinygrad.help...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/ib.py
tinygrad_repo/tinygrad/runtime/support/ib.py
from __future__ import annotations import resource, ctypes, weakref, functools, itertools, tinygrad.runtime.autogen.ib as ib from typing import Iterator from dataclasses import dataclass from weakref import WeakKeyDictionary from tinygrad.device import Buffer, DMACPURef, DMAFdRef from tinygrad.helpers import getenv, ro...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/__init__.py
tinygrad_repo/tinygrad/runtime/support/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/usb.py
tinygrad_repo/tinygrad/runtime/support/usb.py
import ctypes, struct, dataclasses, array, itertools from typing import Sequence from tinygrad.runtime.autogen import libusb from tinygrad.helpers import DEBUG, to_mv, round_up, OSX from tinygrad.runtime.support.hcq import MMIOInterface class USB3: def __init__(self, vendor:int, dev:int, ep_data_in:int, ep_stat_in:i...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/webgpu.py
tinygrad_repo/tinygrad/runtime/support/webgpu.py
import ctypes, ctypes.util, os, subprocess, platform, sysconfig from tinygrad.helpers import OSX WEBGPU_PATH: str | None if OSX: if not os.path.exists(brew_prefix:=subprocess.check_output(['brew', '--prefix', 'dawn']).decode().strip()): raise FileNotFoundError('dawn library not found. Install it with `brew tap ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/compiler_amd.py
tinygrad_repo/tinygrad/runtime/support/compiler_amd.py
import ctypes, subprocess import tinygrad.runtime.autogen.comgr as comgr assert comgr.AMD_COMGR_LANGUAGE_HIP == 4 try: comgr.amd_comgr_get_version(ctypes.byref(major:=ctypes.c_uint64()), ctypes.byref(minor:=ctypes.c_uint64())) if major.value >= 3: # in comgr 3 the values of enums in headers were changed: https:...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/amd.py
tinygrad_repo/tinygrad/runtime/support/amd.py
import functools, importlib, re, urllib from collections import defaultdict from dataclasses import dataclass from tinygrad.helpers import getbits, round_up, fetch from tinygrad.runtime.autogen import pci from tinygrad.runtime.support.usb import ASM24Controller @dataclass class AMDReg: name:str; offset:int; segment:...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/nv/nvdev.py
tinygrad_repo/tinygrad/runtime/support/nv/nvdev.py
from __future__ import annotations import ctypes, time, functools, re, gzip, struct from tinygrad.helpers import getenv, DEBUG, fetch, getbits, to_mv from tinygrad.runtime.support.hcq import MMIOInterface from tinygrad.runtime.support.memory import TLSFAllocator, MemoryManager from tinygrad.runtime.support.nv.ip import...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/nv/__init__.py
tinygrad_repo/tinygrad/runtime/support/nv/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/nv/ip.py
tinygrad_repo/tinygrad/runtime/support/nv/ip.py
from __future__ import annotations import ctypes, time, array, struct, itertools, dataclasses from typing import cast, Any from tinygrad.runtime.autogen.nv import nv from tinygrad.helpers import to_mv, lo32, hi32, DEBUG, round_up, round_down, mv_address, fetch, wait_cond from tinygrad.runtime.support.system import Syst...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/am/amdev.py
tinygrad_repo/tinygrad/runtime/support/am/amdev.py
from __future__ import annotations import ctypes, collections, dataclasses, functools, os, hashlib from tinygrad.helpers import mv_address, getenv, DEBUG, fetch from tinygrad.runtime.autogen.am import am from tinygrad.runtime.support.hcq import MMIOInterface from tinygrad.runtime.support.amd import AMDReg, import_modul...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/am/__init__.py
tinygrad_repo/tinygrad/runtime/support/am/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/support/am/ip.py
tinygrad_repo/tinygrad/runtime/support/am/ip.py
import ctypes, time, contextlib, functools from typing import Literal from tinygrad.helpers import to_mv, data64, lo32, hi32, DEBUG, wait_cond from tinygrad.runtime.autogen.am import am from tinygrad.runtime.support.amd import import_soc class AM_IP: def __init__(self, adev): self.adev = adev def init_sw(self): pa...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/graph/cuda.py
tinygrad_repo/tinygrad/runtime/graph/cuda.py
import ctypes from typing import Any, cast import tinygrad.runtime.autogen.cuda as cuda from tinygrad.helpers import init_c_var, dedup from tinygrad.device import Buffer, Device from tinygrad.runtime.ops_cuda import CUDADevice, check, encode_args, cu_time_execution from tinygrad.engine.realize import ExecItem, BufferXf...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/graph/metal.py
tinygrad_repo/tinygrad/runtime/graph/metal.py
from typing import Any, cast import ctypes, re, decimal from tinygrad.dtype import dtypes from tinygrad.helpers import dedup, getenv, merge_dicts, PROFILE from tinygrad.device import Buffer, ProfileGraphEntry, ProfileGraphEvent from tinygrad.engine.realize import ExecItem, CompiledRunner from tinygrad.engine.jit import...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/graph/hcq.py
tinygrad_repo/tinygrad/runtime/graph/hcq.py
import collections, time from typing import Any, cast from tinygrad.helpers import round_up, PROFILE, merge_dicts, getenv, dedup from tinygrad.runtime.support.hcq import HCQCompiled, HCQAllocator, HCQSignal, HCQBuffer, HWQueue, HCQArgsState, BumpAllocator, MMIOInterface from tinygrad.device import Buffer, BufferSpec, C...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/graph/__init__.py
tinygrad_repo/tinygrad/runtime/graph/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/graph/remote.py
tinygrad_repo/tinygrad/runtime/graph/remote.py
import time, itertools from tinygrad.engine.jit import MultiGraphRunner from tinygrad.engine.realize import CompiledRunner, BufferXfer, ExecItem from tinygrad.device import Device, Compiled, Buffer from tinygrad.runtime.ops_remote import RemoteDevice, RemoteConnection, RemoteRequest, GraphComputeItem, Transfer, GraphAl...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/amd_gpu.py
tinygrad_repo/tinygrad/runtime/autogen/amd_gpu.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, os class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/cuda.py
tinygrad_repo/tinygrad/runtime/autogen/cuda.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-D__CUDA_API_VERSION_INTERNAL'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMix...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/adreno.py
tinygrad_repo/tinygrad/runtime/autogen/adreno.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, os A6XX_XML = True # macro # def __struct_cast(X): # macro # return (structX) REG_CP_LOAD_STATE_0 = 0x00000000 # macro CP_LOAD_STATE_0_DST_OFF__MASK = 0x0000ffff ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/kfd.py
tinygrad_repo/tinygrad/runtime/autogen/kfd.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, os import functools from tinygrad.runtime.support.hcq import FileIOInterface def _do_ioctl(__idir, __base, __nr, __user_struct, __fd:FileIOInterface, **kwargs): ret...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/io_uring.py
tinygrad_repo/tinygrad/runtime/autogen/io_uring.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a structure, assume i...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/llvm.py
tinygrad_repo/tinygrad/runtime/autogen/llvm.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-I/usr/lib/llvm-14/include', '-D_GNU_SOURCE', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, tinygrad.runtime.support.llvm as llvm_support ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/libusb.py
tinygrad_repo/tinygrad/runtime/autogen/libusb.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util, os class FunctionFactoryStub: def __getattr__(self, _): return ctypes.CFUNCTYPE(lambda y:y) # libraries['libusb'] explanation # As you did not l...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/hsa.py
tinygrad_repo/tinygrad/runtime/autogen/hsa.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-I/opt/rocm/include'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util, os def string_cast(char_pointer, encoding='utf-8', errors='strict'): value = ctypes.cast(char_pointer, ctypes.c_char_p).value ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/hip.py
tinygrad_repo/tinygrad/runtime/autogen/hip.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-D__HIP_PLATFORM_AMD__', '-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, os class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinst...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/libc.py
tinygrad_repo/tinygrad/runtime/autogen/libc.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util, os c_int128 = ctypes.c_ubyte*16 c_uint128 = c_int128 void = None if ctypes.sizeof(ctypes.c_longdouble) == 16: c_long_double_t = ctypes.c_longdouble els...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/nvrtc.py
tinygrad_repo/tinygrad/runtime/autogen/nvrtc.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util _libraries = {} _libraries['libnvrtc.so'] = ctypes.CDLL(ctypes.util.find_library('nvrtc')) def string_cast(char_pointer, encoding='utf-8', errors='strict'):...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/pci.py
tinygrad_repo/tinygrad/runtime/autogen/pci.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes LINUX_PCI_REGS_H = True # macro PCI_CFG_SPACE_SIZE = 256 # macro PCI_CFG_SPACE_EXP_SIZE = 4096 # macro PCI_STD_HEADER_SIZEOF = 64 # macro PCI_STD_NUM_BARS = 6 # macro ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/comgr.py
tinygrad_repo/tinygrad/runtime/autogen/comgr.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-D__HIP_PLATFORM_AMD__', '-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util, os PATHS_TO_TRY = [ '/opt/rocm/lib/libamd_comgr.so', os.getenv('ROCM_PATH', '')+'/lib/libamd_...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/sqtt.py
tinygrad_repo/tinygrad/runtime/autogen/sqtt.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, os class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a structure, assu...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/nv_gpu.py
tinygrad_repo/tinygrad/runtime/autogen/nv_gpu.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-include', '/tmp/open-gpu-kernel-modules-81fe4fb417c8ac3b9bdcc1d56827d116743892a5/src/common/sdk/nvidia/inc/nvtypes.h', '-I/tmp/open-gpu-kernel-modules-81fe4fb417c8ac3b9bdcc1d56827d116743892a5/src/common/inc', '-I/tmp/open-gpu-kernel-modules-81fe4fb417...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/opencl.py
tinygrad_repo/tinygrad/runtime/autogen/opencl.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a struct...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/qcom_dsp.py
tinygrad_repo/tinygrad/runtime/autogen/qcom_dsp.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a structure, assume i...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/ib.py
tinygrad_repo/tinygrad/runtime/autogen/ib.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, ctypes.util class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a struct...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/kgsl.py
tinygrad_repo/tinygrad/runtime/autogen/kgsl.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, os class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a structure, assu...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/webgpu.py
tinygrad_repo/tinygrad/runtime/autogen/webgpu.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes, tinygrad.runtime.support.webgpu as webgpu_support class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, As...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/vfio.py
tinygrad_repo/tinygrad/runtime/autogen/vfio.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes from tinygrad.runtime.support.hcq import FileIOInterface import functools def _do_ioctl_io(__idir, __base, __nr, __fd:FileIOInterface, val=0, __len=0): return __fd.io...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/nv/nv.py
tinygrad_repo/tinygrad/runtime/autogen/nv/nv.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-DRPC_MESSAGE_STRUCTURES', '-DRPC_STRUCTURES', '-include', '/tmp/open-gpu-kernel-modules-81fe4fb417c8ac3b9bdcc1d56827d116743892a5/src/common/sdk/nvidia/inc/nvtypes.h', '-I/tmp/open-gpu-kernel-modules-81fe4fb417c8ac3b9bdcc1d56827d116743892a5/src/nvidia/...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/smu_v13_0_0.py
tinygrad_repo/tinygrad/runtime/autogen/am/smu_v13_0_0.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a structure, assume i...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/pm4_nv.py
tinygrad_repo/tinygrad/runtime/autogen/am/pm4_nv.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a structure, assume i...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/sdma_4_0_0.py
tinygrad_repo/tinygrad/runtime/autogen/am/sdma_4_0_0.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/pm4_soc15.py
tinygrad_repo/tinygrad/runtime/autogen/am/pm4_soc15.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: [] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not a structure, assume i...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/sdma_4_4_2.py
tinygrad_repo/tinygrad/runtime/autogen/am/sdma_4_4_2.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/sdma_5_0_0.py
tinygrad_repo/tinygrad/runtime/autogen/am/sdma_5_0_0.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/am.py
tinygrad_repo/tinygrad/runtime/autogen/am/am.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-include', 'stdint.h'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/smu_v14_0_2.py
tinygrad_repo/tinygrad/runtime/autogen/am/smu_v14_0_2.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-include', 'stdint.h'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): # not...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/runtime/autogen/am/sdma_6_0_0.py
tinygrad_repo/tinygrad/runtime/autogen/am/sdma_6_0_0.py
# mypy: ignore-errors # -*- coding: utf-8 -*- # # TARGET arch is: ['-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import ctypes class AsDictMixin: @classmethod def as_dict(cls, self): result = {} if not isinstance(self, AsDictMixin): ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/schedule/grouper.py
tinygrad_repo/tinygrad/schedule/grouper.py
from tinygrad.uop.ops import Ops, UOp, resolve, can_pad, GroupOp, UPat, PatternMatcher, graph_rewrite from tinygrad.helpers import all_int, prod, unwrap, dedup, DONT_REALIZE_EXPAND, DONT_GROUP_REDUCES, FUSE_CONV_BW from tinygrad.shape.shapetracker import ShapeTracker ALWAYS_CONTIGUOUS: set[Ops] = {Ops.CONTIGUOUS, Ops....
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/schedule/rangeify.py
tinygrad_repo/tinygrad/schedule/rangeify.py
from typing import Any, cast import functools, operator from dataclasses import dataclass, field from tinygrad.dtype import dtypes, PtrDType, ImageDType, AddrSpace from tinygrad.uop.ops import PatternMatcher, UPat, Ops, UOp, resolve, GroupOp, RewriteNotReady, _substitute, ssimplify, graph_rewrite_map from tinygrad.uop....
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/schedule/multi.py
tinygrad_repo/tinygrad/schedule/multi.py
from typing import cast import functools, itertools, operator from tinygrad.helpers import all_same, all_int, prod, DEBUG, RING, getenv, unwrap from tinygrad.uop.ops import Ops, UOp, sint, PatternMatcher, UPat, GroupOp, resolve from tinygrad.device import Device # *** allreduce implementation *** def handle_allreduce_...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/schedule/kernelize.py
tinygrad_repo/tinygrad/schedule/kernelize.py
from dataclasses import dataclass from tinygrad.uop.ops import UOp, Ops, GroupOp, PatternMatcher, UPat, graph_rewrite, graph_rewrite_map, identity_element, resolve from tinygrad.uop.ops import track_rewrites, _substitute, KernelInfo from tinygrad.uop.spec import type_verify, tensor_uop_spec from tinygrad.uop.symbolic i...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/schedule/__init__.py
tinygrad_repo/tinygrad/schedule/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/nn/datasets.py
tinygrad_repo/tinygrad/nn/datasets.py
from tinygrad.tensor import Tensor from tinygrad.nn.state import tar_extract def mnist(device=None, fashion=False): base_url = "http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/" if fashion else "https://storage.googleapis.com/cvdf-datasets/mnist/" def _mnist(file): return Tensor.from_url(base_url+file, ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/nn/optim.py
tinygrad_repo/tinygrad/nn/optim.py
# sorted in order of increasing complexity import itertools from tinygrad.helpers import dedup, flatten, getenv, unwrap, FUSE_OPTIM from tinygrad.tensor import Tensor from tinygrad.dtype import dtypes, least_upper_dtype class Optimizer: """ Base class for all optimizers. """ def __init__(self, params: list[Ten...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/nn/state.py
tinygrad_repo/tinygrad/nn/state.py
import json, pathlib, zipfile, pickle, tarfile, struct, functools, io from collections import OrderedDict from typing import Any, Callable, BinaryIO, Iterable from tinygrad.tensor import Tensor from tinygrad.dtype import dtypes from tinygrad.helpers import prod, argsort, DEBUG, Timing, CI, unwrap, GlobalCounters, tqdm,...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/nn/__init__.py
tinygrad_repo/tinygrad/nn/__init__.py
from __future__ import annotations import math from tinygrad.tensor import Tensor from tinygrad.dtype import dtypes from tinygrad.device import is_dtype_supported from tinygrad.helpers import prod, make_tuple, flatten from tinygrad.nn import optim, state, datasets # noqa: F401 class BatchNorm: """ Applies Batch N...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/frontend/__init__.py
tinygrad_repo/tinygrad/frontend/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/frontend/torch.py
tinygrad_repo/tinygrad/frontend/torch.py
# type: ignore import sys, pathlib sys.path.append(pathlib.Path(__file__).parent.parent.as_posix()) try: import extra.torch_backend.backend # noqa: F401 # pylint: disable=unused-import except ImportError as e: raise ImportError("torch frontend not in release\nTo fix, install tinygrad from a git checkout with pip insta...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/frontend/onnx.py
tinygrad_repo/tinygrad/frontend/onnx.py
# pylint: disable=possibly-unused-variable from typing import Any, Sequence, cast, Literal, NamedTuple, Generator import dataclasses, functools, io, math, types, warnings, pathlib, sys, os, struct, enum from io import BufferedReader from tinygrad.nn.state import TensorIO from tinygrad.tensor import Tensor, _broadcast_s...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
true
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/engine/memory.py
tinygrad_repo/tinygrad/engine/memory.py
from typing import cast from collections import defaultdict from tinygrad.engine.schedule import ScheduleItem from tinygrad.device import Device, Buffer from tinygrad.helpers import NO_MEMORY_PLANNER, dedup, DEBUG, round_up from tinygrad.uop.ops import Ops from tinygrad.dtype import dtypes, ImageDType from tinygrad.run...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/tinygrad_repo/tinygrad/engine/schedule.py
tinygrad_repo/tinygrad/engine/schedule.py
from typing import cast from dataclasses import dataclass, field from collections import deque, defaultdict from tinygrad.uop.ops import UOp, Ops, buffers from tinygrad.device import Device, Buffer, MultiBuffer from tinygrad.helpers import Metadata, all_same # **** ScheduleItem return type @dataclass(frozen=True) cla...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false