gemini-2.5-flash| input-price: 0.3 output-price: 2.5 max-context-length: 128_000 (cost: $0.04) Β· Anfrage: 2025-08-18T09:14:33.382842
Generated by rs-summarizer Version unbekannt
Abstract:
Tilus is a novel domain-specific language (DSL) for GPU programming, designed to simplify the development of high-performance kernels with fine-grained control over hardware resources. It operates at the thread-block level, treating tensors as primary data types, and offers explicit management of shared memory and registers, alongside support for arbitrary low-precision integer and floating-point types (1-8 bits). The language features automatic tuning, caching of compiled kernels, and a Pythonic interface for ease of use. Built upon the Hidet IR and runtime system, Tilus incorporates advanced optimization techniques like asynchronous memory copies, software pipelining, and split-K aggregation, demonstrating performance comparable to vendor libraries for tasks like matrix multiplication and flash attention. Contributions to the project require signed commits adhering to the Developer Certificate of Origin.
Summarizing Tilus: A GPU Kernel Programming Language
pip install tilus or from source for development purposes.tilus.Script, implementing __init__ for compilation-time setup (e.g., hyperparameters) and __call__ for the core kernel logic. Key attributes like self.attrs.blocks (number of thread blocks) and self.attrs.warps (warps per block) must be specified.int, float, bool) are treated as compile-time constants, triggering new compilations for different values. Parameters with Tilus-specific types (int32, float16) are runtime-known.float32, int32 to arbitrary bit-width integers (e.g., int1b to int7b) and sub-byte floating-point types (e.g., float3_e1m1 to float8_e5m2).global_view from pointers or global_tensor for kernel-managed allocation.shared_tensor and freed with free_shared. All threads in a block can access shared memory, with performance considerations for access patterns (e.g., bank conflicts).register_tensor.spatial, local, compose, and reduce. Register layouts are "distributed layouts" mapping (thread_id, local_id) to tensor indices.global_view, register_tensor, shared_tensor, free_shared.load_global, store_global, load_shared, store_shared.copy_async, copy_async_commit_group, copy_async_wait_group, copy_async_wait_all (for overlapping computation and memory transfers).dot (for matrix multiplication).add, exp, maximum, where, etc.max, min, sum.assign, cast, view, transpose, squeeze, unsqueeze, repeat, repeat_interleave.lock_semaphore, release_semaphore.sync.assume, annotate_layout, print_tensor, printf.if/elif/else, for (with optional unroll parameter for loop unrolling), while, break, and continue.@tilus.autotune decorator allows defining search spaces for hyperparameters (e.g., warps, tile sizes, optimization knobs). Tilus automatically explores these configurations to find the best performing kernel for a given input.~/.cache/tilus (or a custom directory) to speed up subsequent calls. Users can also dump intermediate representations (IRs) for debugging.build_program function orchestrates program verification, optimization (Tilus IR and Hidet IR), CUDA C code generation, and final compilation into a shared library (.so).