diff --git a/tinygrad/lazy.py b/tinygrad/lazy.py index 5da21069b3..d5b994f844 100644 --- a/tinygrad/lazy.py +++ b/tinygrad/lazy.py @@ -6,7 +6,7 @@ from tinygrad.helpers import prod, getenv, all_int, all_same from tinygrad.ops import LoadOps, UnaryOps, BinaryOps, TernaryOps, ReduceOps, Op, exec_alu, python_alu from tinygrad.shape.symbolic import sint from tinygrad.shape.shapetracker import ShapeTracker -from tinygrad.device import Buffer +from tinygrad.buffer import Buffer from weakref import ref, ReferenceType, WeakValueDictionary lazycache: WeakValueDictionary[Any, LazyBuffer] = WeakValueDictionary() diff --git a/tinygrad/runtime/graph/hsa.py b/tinygrad/runtime/graph/hsa.py index c5cc90f32d..5161b9100e 100644 --- a/tinygrad/runtime/graph/hsa.py +++ b/tinygrad/runtime/graph/hsa.py @@ -1,7 +1,8 @@ import ctypes, collections, time, itertools from typing import List, Any, Dict, cast, Optional, Union, Tuple from tinygrad.helpers import GraphException, init_c_var, round_up -from tinygrad.device import Compiled, Buffer, BufferOptions, CompiledASTRunner, BufferXfer, MultiDeviceJITGraph, update_stats, Device +from tinygrad.buffer import Buffer, BufferOptions +from tinygrad.device import Compiled, CompiledASTRunner, BufferXfer, MultiDeviceJITGraph, update_stats, Device from tinygrad.shape.symbolic import Variable from tinygrad.runtime.ops_hsa import HSADevice, PROFILE, Profiler from tinygrad.engine.jit import JitItem, get_input_replace, get_jit_stats, \ diff --git a/tinygrad/runtime/ops_cuda.py b/tinygrad/runtime/ops_cuda.py index ed6eb3d388..f1016582ef 100644 --- a/tinygrad/runtime/ops_cuda.py +++ b/tinygrad/runtime/ops_cuda.py @@ -4,7 +4,8 @@ from pathlib import Path from typing import Tuple, Optional, List import tinygrad.runtime.autogen.cuda as cuda from tinygrad.helpers import DEBUG, getenv, from_mv, to_char_p_p, init_c_var, init_c_struct_t, colored, cpu_time_execution -from tinygrad.device import Compiled, LRUAllocator, MallocAllocator, Compiler, BufferOptions, CompilerOptions +from tinygrad.device import Compiled, LRUAllocator, MallocAllocator, Compiler, CompilerOptions +from tinygrad.buffer import BufferOptions from tinygrad.renderer.cstyle import CUDARenderer from tinygrad.renderer.assembly import PTXRenderer if getenv("IOCTL"): import extra.nv_gpu_driver.nv_ioctl # noqa: F401 diff --git a/tinygrad/runtime/ops_gpu.py b/tinygrad/runtime/ops_gpu.py index f0449990db..da6332d039 100644 --- a/tinygrad/runtime/ops_gpu.py +++ b/tinygrad/runtime/ops_gpu.py @@ -4,7 +4,8 @@ import ctypes, functools, hashlib import tinygrad.runtime.autogen.opencl as cl from tinygrad.helpers import init_c_var, to_char_p_p, from_mv, OSX, DEBUG from tinygrad.renderer.cstyle import OpenCLRenderer -from tinygrad.device import Compiled, LRUAllocator, BufferOptions, Compiler, CompilerOptions +from tinygrad.buffer import BufferOptions +from tinygrad.device import Compiled, LRUAllocator, Compiler, CompilerOptions # see test/external/external_osx_profiling.py to determine this ratio. it's in like GPU clocks or something OSX_TIMING_RATIO = (125/3) if OSX else 1.0 diff --git a/tinygrad/runtime/ops_hsa.py b/tinygrad/runtime/ops_hsa.py index 5f95236291..60e97c6e0a 100644 --- a/tinygrad/runtime/ops_hsa.py +++ b/tinygrad/runtime/ops_hsa.py @@ -3,9 +3,10 @@ import ctypes, functools, subprocess, io, atexit, collections, json from typing import Tuple, TypeVar, List, Dict, Any import tinygrad.runtime.autogen.hsa as hsa from tinygrad.helpers import DEBUG, init_c_var, from_mv, round_up, to_mv, init_c_struct_t, getenv -from tinygrad.device import Compiled, LRUAllocator, BufferOptions, Compiler, CompilerOptions -from tinygrad.runtime.driver.hsa import check, scan_agents, find_memory_pool, AQLQueue +from tinygrad.device import Compiled, LRUAllocator, Compiler, CompilerOptions +from tinygrad.buffer import BufferOptions from tinygrad.renderer.cstyle import HIPRenderer +from tinygrad.runtime.driver.hsa import check, scan_agents, find_memory_pool, AQLQueue from tinygrad.runtime.driver.hip_comgr import compile_hip if getenv("IOCTL"): import extra.hip_gpu_driver.hip_ioctl # noqa: F401 diff --git a/tinygrad/runtime/ops_kfd.py b/tinygrad/runtime/ops_kfd.py index 5f66f9794d..79e9ea6151 100644 --- a/tinygrad/runtime/ops_kfd.py +++ b/tinygrad/runtime/ops_kfd.py @@ -1,7 +1,8 @@ from __future__ import annotations from typing import Tuple, Any import os, fcntl, ctypes, functools, re, pathlib, mmap, struct, errno, io -from tinygrad.device import Compiled, LRUAllocator, Compiler, BufferOptions, CompilerOptions +from tinygrad.device import Compiled, LRUAllocator, Compiler, CompilerOptions +from tinygrad.buffer import BufferOptions from tinygrad.helpers import getenv, from_mv, init_c_struct_t, to_mv, round_up from tinygrad.renderer.cstyle import HIPRenderer from tinygrad.runtime.driver.hip_comgr import compile_hip