This document lists the noteworthy changes in every release of cuTile.jl, newest first. It is a hand-written summary aimed at users; for the complete list of merged pull requests, see the GitHub releases.
New features:
- Added support for
Float8_E5M3FNUfrom Microfloats.jl, an unsigned 8-bit float used as the block scale of FP4ct.muladd_scaled(#334).
Minor changes:
CUDA_Tile_jllis no longer a dependency.code_tiledand@device_code_tileddisassemble with thetileirdisasmthat ships with CUDA 13.4 and newer, whichCUDA_Compiler_jllselects by default on any CUDA 13 driver; with an older compiler selected, they now throw an error. Without a GPU, select a compiler through theCUDA_Compiler_jllversionpreference; macOS can no longer disassemble Tile IR. Kernel compilation is unaffected.
The README's single long tutorial was replaced by a documentation site at https://juliagpu.github.io/cuTile.jl, with tutorials, a manual, an API reference, a compatibility matrix stating what each feature needs from the Tile IR version and the GPU architecture, and a comparison with cuTile Python (#284).
The rest of the cycle went into catching up with Tile IR 13.4 and with cuTile
Python: view-based atomic reductions, sparse and stepped array views,
eachtile, array-construction syntax, multi-dimensional reductions, 64-bit
array indexing, and programmatic dependent launch.
Breaking changes:
TileArraygained an index-type parameter:TileArray{T,N,Spec}is nowTileArray{T,N,I,Spec}, withIeitherInt32orInt64. Sizes and strides useInt32when they fit andInt64otherwise, chosen when the argument is converted, so crossing the boundary compiles a separate kernel.ct.TileArray(a; index=Int64)selects the wide path explicitly andct.indextypereports it;Int64indexing requires bytecode v13.3 (#292).ArraySpecgained two type parameters,may_alias_internally(whether two distinct in-bounds indices can name the same memory) andsingleton(which axes have both size and stride one). Both are derived from the runtime sizes and strides, and the existing positional constructor still works (#262, #296).ct.catwas removed in favor of Julia's own concatenation syntax, described under new features below (#289).- The bitwise atomics
atomic_or,atomic_andandatomic_xorno longer convert the update value: it has to have the array's element type already (#283). - The disk cache is configured through package preferences instead of
environment variables:
disk_cache = falsedisables it,cache_diroverrides its directory andcache_size_bytesits 1 GiB limit.JULIA_CUTILE_CACHE_DIRandJULIA_CUTILE_CACHE_SIZEare gone (#296).
New features:
- Added support for programmatic dependent launch, which overlaps the tail of
one kernel with the preamble of the next one on the same stream. The consumer
is launched with
@cuda backend=cuTile dependent=true, the producer callsct.grid_dependency_control_launch_dependents(), and the consumer callsct.grid_dependency_control_wait()before reading the producer's results. Requires Tile IR 13.4 and compute capability 9.0 or newer.launchalso gained astreamkeyword argument (#299). - Added view-based atomic reductions:
atomic_store_add,atomic_store_max,atomic_store_min,atomic_store_or,atomic_store_andandatomic_store_xorreduce a tile into aTileArrayor into a window of aneachtileview without returning the old value. On top of them sitsct.@atomic, aBase-style macro with statement forms (ct.@atomic a[i] += v) and a value form returningold => new. Requires bytecode v13.3 (#283). - The read-modify-write
atomic_*functions gained amask, AND'd with the bounds mask; masked-out elements are not modified, andatomic_casreturnsexpectedfor them while the others return an implementation-defined value (#297). - Added
eachtile(a, shape; step=shape), an indexable device-side collection of fixed-shape tile windows:tiles[i, j]loads andtiles[i, j] = tilestores. Astepsmaller than the tile shape produces overlapping windows and a larger one gapped windows; unequal shape and step require bytecode v13.3 (#281). view,@viewand@viewson aTileArrayaccept more index kinds. Positive step ranges scale that axis' element stride. A 1D integerTilein exactly one dimension, combined with unit ranges or:in the others, creates a sparse view thatct.loadandct.storeconsume as a Tile IR gather/scatter view. Both require bytecode v13.3 (#280, #282).- Julia's array-construction syntax builds tiles inside kernels:
[a, b, c]and typed forms likeFloat32[a, b], bracket concatenation ([A; B],[a b; C],[A;;; B]) of scalars and tiles, andcat(A, B...; dims). Typed empty literals such asFloat32[]produce zero-volume tiles, which are folded away by concatenation and rejected with an explanatory error where Tile IR cannot represent them (#289, #291). - Reductions take a multi-dimensional
dims: an integer, an iterable of integers, or:for a scalar result. This covers the tile-level and the host-levelct.Tiledreductions alike, anddropdimsaccepts a tuple (#290).maximum,minimum,argmaxandargminadditionally take apropagate_nankeyword argument, whose default of ignoring NaNs matches cuTile Python (#278). - Added support for Tile IR bytecode v13.4, emitted by default when
tileirasaccepts it. With it comect.insert, which replaces a non-overlapping subtile and invertsct.extract, andcheck_bounds=falseonct.loadandct.store, an explicit promise that the whole tile lies inside the array (#278, #287). - Float-to-float conversions accept an explicit rounding mode:
Float32(x, RoundDown)andFloat32.(tile, RoundUp), withRoundNearest,RoundToZero,RoundDown,RoundUpandRoundNearestTiesAway. Anything other than round-to-nearest requires Tile IR 13.4 (#294). ct.loadandct.storeacceptmemory_orderandmemory_scope. Loads takeWeak,RelaxedorAcquireand storesWeak,RelaxedorRelease; anything butWeakrequires a scope (#296).ct.code_tiledandct.@device_code_tiledtakeremarks=trueto runtileirasand print its optimization remarks, which report tensor-core selection and memory alignment issues. Requirestileiras13.4 (#293).ct.arangetakesstartandstepkeyword arguments, and Julia'smodand act.divmodare available in kernels, both with Julia's floored sign convention (#278).
Minor changes:
- Values crossing into and out of arrays convert like they do in Julia:
ct.storeandct.scatterconvert to the array's element type instead of demanding an exact match, and a scalar in a broadcast takes the element type of the tile it is combined with, sotile .* 2.0over aFloat32tile stays inFloat32(#296). ^with an integer exponent goes throughpowand restores the sign from the exponent's parity, rather than the squaring chain it used for small literal exponents (#287).@inboundsand--check-boundsare resolved at compile time, so ordinary Julia@boundscheckblocks in a kernel cost nothing. They deliberately do not affect the bounds handling ofct.load,ct.store,eachtile, views, gathers, scatters or atomics: Tile IR's checked memory operations define what partial edge tiles do rather than protect against a mistake, so padding and clipping are part of a correct kernel's result. Usecheck_bounds=falsefor the stronger promise (#279, #288).- Toolchain selection was unified and its inputs validated: an unsupported
bytecode_versionpreference, a version the selectedtileirascannot compile, and a version too old for the target architecture are all reported as errors naming what was selected.cuTile.versioninfo()shows the selected version next to the highest onetileirasaccepts, and a newcompiler_timeout_secondspreference bounds eachtileirasinvocation (#298, #296, #300). - Several invalid uses are now rejected rather than silently miscompiled: an
orderargument that is not a permutation of the axes, anassume_divisible_bythat contradicts a known constant, andreinterpretto or fromBool(#278, #296).
Bug fixes:
- Fixed a write-after-write race in the token-ordering pass. Its loop-parallel
store optimization accepted any index transitively derived from the induction
variable as injective, including expressions like
(i + 1) ÷ 2, so stores from different iterations could hit the same address with no ordering between them (#262). - Fixed soundness holes in the bounds and divisibility analyses, which drive
bounds masks,
nsw/nuwflags and alignment assumptions: stepped loops could get a bound the loop overshoots, unrefuted facts survived a join through never-visited statements, zero-extension was treated as value-preserving for possibly-negative ranges, and arithmetic ranges were not clamped to the result width (#265, #277). atomic_maxandatomic_minon arrays with an unsigned element type compared as signed (#283).- Host-level reductions over
ct.Tiledarrays handle adimsregion that is empty or reaches past the array's rank, and reject a non-integer or non-positive dimension with an error instead of failing later (#290).
Kernels are now launched through CUDA.jl's @cuda, and compilation results
persist across sessions. cuTile.jl no longer keeps its CUDA support in a package
extension: it depends on CUDACore directly and registers a back-end with
CUDACore's launch protocol, so the same @cuda, cufunction and kernel-object
structure that the LLVM back-end uses also applies to Tile IR kernels.
Breaking changes:
- The combiner passed to
reduce,mapreduceandaccumulatenow receives its arguments in(accumulator, element)order, matchingBase. Tile IR delivers them the other way around, and the previous binding forwarded them unswapped, which silently computed the wrong result for non-commutative combiners (#203). - Matrix multiplication of tiles now runs the accumulator in the element type
Tile IR allows for the input type and converts the result back, so
BFloat16 * BFloat16accumulates inFloat32and still returns aBFloat16tile (#218). - Operations that used to emit invalid bytecode now raise an error at compile
time:
mul_hion signed integers (Tile IR's is unsigned-only, soreinterpretthe operands),memory_order=MemoryOrder.Weakon atomics, andreduce/accumulateoverTFloat32tiles (#203, #218). Constant{T,V}throws anInexactErrorwhenVdoes not fit inT, rather than truncating the value during codegen, andArraySpecrejectscontiguous=truecombined with a first stride divisor other than 0 or 1 (#212, #218).
New features:
- Kernels can be launched with
@cuda backend=cuTile blocks=grid f(args...).cuTile.cufunction(f, tt)compiles a kernel and returns aTileKernelthat can be called repeatedly without going through method-instance lookup again. Launch arguments are converted with Adapt.jl, so a user-defined struct with anAdapt.adapt_structuremethod has its arrays converted recursively.cuTile.launch(f, grid, args...)remains available (#214). - Compiled cubins are now cached on disk, in an LMDB database in cuTile's
scratchspace, keyed on the bytecode, the target architecture, the optimization
level and the
tileirasversion. A second session running the same kernel skipstileirasentirely; on the FFT example that cuts time-to-first-result from 34 s to 8.3 s. The cache is capped at 1 GiB and evicts the least-recently-used entries (#216). - Kernels can generate random numbers:
rand,randnandrandexpreturn scalars or tiles from a tile-vectorized Philox2x32-7 generator.cuTile.DeviceRNG()opens an independent stream that can be re-seeded withRandom.seed!, and each launch is keyed on a fresh host seed. On the host,cuTile.RNGfillsCuArrays throughRandom.rand!,randn!andrandexp!(#193, #204). viewand@viewderive a sub-rangeTileArrayfrom an existing one. Every index has to be:or aUnitRange; other index types are rejected at compile time (#191).permutedims,transposeandreshapenow also apply to aTileArray, adjusting sizes and strides without touching memory.reshapeis column-major and requires a contiguous source (#194).- Integer matrix multiplication is supported:
Int8/UInt8operands with anInt32accumulator, with per-operand signedness derived from the Julia types (#203). - Additional operations work in kernels:
atan(y, x)(requires Tile IR 13.2),fldanddiv(x, y, RoundDown)on floats, and^with an integer exponent. Therounding_modeof the enclosing@fpmodescope is now forwarded totanh(#193, #203, #218).
Minor changes:
- CUDACore is a regular dependency now instead of a weak one, so
launchno longer errors out asking for CUDA.jl to be imported first. Requires CUDACore 6.1 and IRStructurizer 0.6 (#214). - First-kernel latency was reduced by precompiling the codegen pipeline with a
representative workload, and by running that pipeline in the world age
captured at
__init__so packages loaded later cannot invalidate it. The vector-addition example went from about 26 s to 14 s (#216). - Launch overhead was reduced: argument flattening is generated at compile time
instead of splatting at run time, the compilation cache is keyed on an
isbitsvalue, and the support check is memoized per device (#214). - The optimizer gained a common-subexpression pass, an interval analysis that
attaches no-wrap flags to integer arithmetic, and a divisibility analysis that
emits
assumeoperations for pointer alignment and for shape and stride divisors. Rewrites now preserve the effect flags that gate CSE and loop-invariant code motion, and normalization runs to a fixed point before FMA fusion so thata*b - c*dfuses the same way every time, which closed a 9% gap on the FFT example (#190, #205, #207, #211, #220). gatherandscatteron contiguous arrays now vectorize. The unit stride of the contiguous axis is folded away instead of being multiplied in as a run-time value, and no alignment is asserted on the resulting tile of pointers; either one madetileirasfall back to 2-byte stores where the equivalent cuTile Python kernel got 16-byte ones. That cut the mixture-of-experts example's kernel time by about 25% (#212, #213, #219).
Bug fixes:
- Fixed
printandprintlnof 64-bit and unsigned integers, which used format specifiers that made the device print the wrong values. Printing a tuple no longer raises an error, and on Tile IR 13.1 a print no longer breaks the memory ordering of the stores and atomics that follow it (#203, #218). !=onBFloat16values now uses the unordered comparison, soNaN != NaNistrue; it previously took a path that also tripped over a shape mismatch (#218).- Kernels that capture a value of non-inferrable type in a closure, and
element-wise subtraction of
BFloat16tiles, no longer fail to compile (#201, #202). - Referring to a global through a
Modulevalue in kernel code now resolves the binding at compile time instead of reporting an unsupported value type. Conversions of a value whose type could not be inferred are no longer assumed to produce a scalar, which used to select the scalarstoremethod for what was actually a multi-element tile and crashtileiras(#201). iota,cat,reshapeand pointer offsetting validate their shapes and element types before emitting bytecode, so invalid uses produce a Julia-level error instead of atileirasfailure (#201, #203).
- Restricted the
CUDA_Compiler_jllcompatibility bound to0.4 - 0.4.3, so that v0.3 does not resolve against newer compiler releases it was not tested with.
- Added support for Tile IR 13.3, which is now the minimum version of
CUDA_Tile_jll, and with it Hopper (sm_90) GPUs. The device check reports the bytecode version cuTile emits rather than the CUDA toolkit version: Blackwell requires 13.1, Ampere and Ada 13.2, and Hopper 13.3 (#234, #236). - The bytecode version to emit is no longer derived from
CUDA_Compiler_jll's CUDA version, but probed by havingtileirascompile an empty module at each supported version. A localtileirasbinary can be selected with thetileiraspreference and the probe overridden with thebytecode_versionpreference;cuTile.versioninfo()reports both (#222). muladdon tiles gained afast_acckeyword argument, which enables lower-precision accumulation for FP8 inputs on Hopper, andcuTile.muladd_scaledwas added for block-scaled multiply-accumulate. Both require Tile IR 13.3,muladd_scaledalso Blackwell (#239).- Added a Microfloats.jl extension, making
Float8_E4M3FN,Float8_E5M2,Float8_E8M0FNUandFloat4_E2M1FNusable as kernel element types (#223, #234). repeat(tile, counts...)andrepeat(tile; inner, outer)implementBase.repeatfor tiles.reinterpret(T, tile)andreinterpret(reshape, T, tile)view a whole tile at a different element width, lowering tobitcast,packorunpack; this is how sub-byte formats travel through memory (#244, #238).- Added the
num_worker_warpsentry hint (4 or 8, Tile IR 13.3 and up), andcuTile.assume_divisible_by(x, divisor), which declares that an index or offset is a multiple ofdivisorso the compiler can prove alignment and widen memory operations (#245, #252). - Code generation no longer stops at the first unsupported construct:
independent errors are collected and reported together in source order as a
CodegenErrorsexception. Juliathrows are handled as well: an unavoidable one becomes a compile-time diagnostic, while a throw on a conditional path becomes a device-side assertion carrying the original message (#248). - Host-side
Tiledbroadcast now follows Base's shape semantics: size-1 dimensions expand to the destination's size, a scalar right-hand side fills the destination, incompatible shapes throw aDimensionMismatch, and empty and 0-dimensional arrays no longer launch malformed grids. In-placect.@.evaluates to the destination array instead of itsTiledwrapper, and host memory is rejected with anArgumentErrorinstead of faulting on the device (#264). - Broadcast arguments that Base wraps in a
Refnow work, so expressions likex .^ 2compile (#255). - Views of device arrays can be passed to kernels: a
SubArrayis converted to a singleTileArrayinstead of being recursed into by Adapt. Kernel array arguments also gained a supertype,AbstractTileArray{T,N}, and the host-side entry points convert withcuTileconvert, so other device array types can hook in (#228, #258). - Compiling large kernels is much faster: the IR rewriting passes cache their
use lookups instead of walking the entire function for every query. Compiling
randnforFloat64went from 13 s to 1.3 s (#235). - The disk cache was rebuilt on LMDB.jl instead of hand-written
liblmdbbindings. Its location and size can be set withJULIA_CUTILE_CACHE_DIRandJULIA_CUTILE_CACHE_SIZE, entries are keyed by a SHA-256 of the compilation inputs so entries written by earlier versions no longer match, and the cache is skipped entirely when thetileirasversion cannot be read (#217, #266). - Several previously accepted but invalid uses are now rejected:
ct.extractvalidates that the slice shape divides the tile shape and that the slice index is in bounds,num_ctas > 1throws on non-Blackwell targets, and reading a non-constglobal from a kernel errors with a message naming the binding (#252, #234, #226). - Fixed kernels whose entire body sits inside control flow being rejected by the
Tile IR verifier, and kernels involving
Varargtuple types tripping up scalar elimination (#246, #237). - Device code now shows up in coverage reports when Julia is run with
--code-coverage. Lines are marked while the kernel is compiled, not while it executes (#249, #259).
Kernels now go through an optimization pipeline before Tile IR is emitted: the
structured IR is canonicalized, constant-folded and rewritten with algebraic and
strength-reduction rules, and then handed to an alias-aware token ordering pass,
loop-invariant code motion and dead code elimination. Tile shapes are also kept
in Tile IR's native row-major order, so reshape and batched matrix
multiplication no longer wrap their operands in permutations. Measured on an RTX
5080, this closes the gap with cuTile Python and overtakes it on several
kernels: layer normalization, which trailed Python by 63% in the previous
release, now runs its forward pass at 931 GB/s against Python's 716 GB/s
(#89,
#142,
#147,
#158,
#165,
#177).
Breaking changes:
ct.where(cond, x, y)was removed. Useifelse.(cond, x, y), which broadcasts and accepts scalar arguments the same way (#180).- The element type of
arangemoved from a positional argument to adtypekeyword argument that defaults toInt32: writect.arange(16)orct.arange(16; dtype=Int64)instead ofct.arange(16, Int32)(#139). - Batched matrix multiplication takes its batch dimensions last,
(M, K, batch...) * (K, N, batch...), instead of first, following Julia's column-major convention. The batch dimensions of the two operands broadcast against each other, and matrix-vector and vector-matrix products are now supported (#132). PaddingMode,MemoryOrderandMemScopeare EnumX enumerations instead of modules ofIntconstants. Spellings such asct.PaddingMode.Zeroare unchanged, but passing a bare integer no longer works (#140).
New features:
- Julia's
forloops work in kernels:for i in start:stopandfor i in start:step:stopare structurized into Tile IRForOps, so the hand-written countingwhileloop that the README used to prescribe is no longer needed (#174). printandprintlnwork inside kernels. Format strings are assembled at compile time from string constants and tile arguments, and string interpolation (println("bid=$bid")) is supported (#173).- Added
ct.@fpmode rounding_mode=... flush_to_zero=... begin ... end, which sets the floating-point rounding mode and flush-to-zero behavior for every operation in the block, including operations in inlined callees. The rounding modes arect.Rounding.NearestEven,Zero,NegInf,PosInfandApprox(#172). - Added the atomic read-modify-write operations
ct.atomic_max,ct.atomic_min,ct.atomic_or,ct.atomic_andandct.atomic_xor(#136). gatherandscatteraccept amaskthat is combined with the automatic bounds check, acheck_bounds=falseto skip that check when the indices are known to be in range, and (forgather) apadding_valuefor masked-out elements. The atomics takecheck_boundsas well (#139, #166).loadandstoreaccept their operands as keyword arguments as well,ct.load(a; index, shape)andct.store(c; index, tile), matching how the same calls are spelled in cuTile Python (#139).- Reductions of a whole
CuArraycan be run through cuTile by wrapping it inct.Tiled:reduce,mapreduce,sum,prod,maximum,minimum,anyandall, with or withoutdims, plus the in-placesum!,prod!,maximum!andminimum!. When the reduction produces one element per block and a hardware atomic exists for the operator, the result is accumulated atomically instead of in a second pass (#134, #141). - Kernels accept more kinds of compile-time arguments: types, either as
ct.Constant(Int)or passed directly tolaunch; the zero-size values Julia has no runtime representation for, such as function singletons andVals; andct.Constant(nothing)(#133, #138, #181). - The emitted bytecode carries source locations, and
tileirasis invoked with--lineinfo, soCUDA.@device_code_sassand profilers can attribute SASS back to Julia source lines.code_tiledand@device_code_tiledprint the locations withdebuginfo=true(#175). isnanis now supported in kernels, andreinterpretmaps onto a Tile IR bitcast (#166, #179).
Minor changes:
- The reflection entry points
code_typed,code_structuredandcode_tiledacceptConstant{T,V}argument types and run the same constant-seeded inference thatlaunchdoes, so the IR they show matches what is compiled.code_structured'svalidatekeyword argument was replaced byoptimize(#157). - Julia 1.13 is supported. Calls without a Tile IR equivalent report a single "Unsupported function call during Tile IR compilation" error naming the function and its argument types, whether the compiler or Julia's inference found no method (#182).
- Added Mixture-of-Experts and fused multi-head attention examples, with Python counterparts for comparison (#163, #170).
Bug fixes:
!=on floating-point values uses an unordered comparison, so comparisons involvingNaNreturntrueas IEEE 754 requires; they returnedfalsebefore (#179).- The alias analysis matched
getfieldagainst the wrongGlobalRefand did not look throughoffset, so every pointer derived from a kernel argument ended up in one alias set. Gathers and scatters that touch different arrays were serialized by token dependencies that dead code elimination could then not remove, which also tripped atileirascrash at-O1and above (#164). - The divisibility computed for array shapes could exceed the maximum divisor,
emitting a
DivBy(32)assumption whereDivBy(16)was intended and specializing kernels more often than necessary (#153). @device_code_tiledno longer fails on kernels containing areduce, where it tried to compile the combiner region as a standalone entry point (#135).
- Fixed the encoding of reduction identity values in the bytecode. Floating
point identities were written as raw bit patterns instead of
ap_int, somaximumrecordedNaNinstead of-Infandminimumrecorded1.5instead of+Inf; integer identities were zigzag-encoded where the format stores raw values, and overflowed fortypemin(Int32)(#186). - Kernel names containing non-ASCII characters no longer fail to compile:
characters outside
[a-zA-Z0-9_]are escaped by codepoint instead of being forced into a single byte (#183). - Added a softmax example, with a Python counterpart (#185).
- Adapted to CUDA.jl v6: the extension is triggered by CUDACore instead of CUDA, and CUDA.jl 6 is now required (#178).
- Fixed the
@device_code_*macros on kernels that take a type argument, which reconstructed it asConstant{DataType,T}and then rejected the resulting signature as non-concrete (#184).
The initial release, published as a call for testing. cuTile.jl compiles Julia
functions to NVIDIA Tile IR bytecode, which the Tile IR assembler then turns
into a CUBIN: kernels are written in terms of whole tiles instead of individual
threads, and the Tile IR compiler decides how to map those onto the hardware.
The model follows NVIDIA's cuTile Python, but the surface is Julia's: Base
operations are routed to Tile IR through an overlay method table, so +, sum,
reshape and broadcasting mean on a tile what they mean on an array. Not all of
Tile IR is implemented, and the supported subset of Julia is only what the
bundled examples exercise; notably, Julia's iterator-based for loops are not
recognized yet, so counted loops have to be written as while loops.
New features:
- A kernel is a plain Julia function that returns
nothing; there is no macro or decorator. Array arguments arrive as aTileArray{T,N,S}carrying the base pointer, sizes and strides, andct.load(arr, index, shape)andct.store(arr, index, tile)move aTile{T,Shape}between the array and registers.ct.bid,ct.num_blocksandct.num_tilesdescribe the grid. Indices are 1-based throughout, following Julia rather than Python. launch(f, grid, args...)compiles a kernel and launches it on the task-bound CUDA stream.CuArrayarguments are converted toTileArrays and flattened into kernel parameters automatically, andname,sm_arch,opt_level,num_ctasandoccupancyare available as keyword arguments. Compilation results are cached, so relaunching a kernel does not recompile it. CUDA.jl has to be imported forlaunchto be available.- Tile operations are spelled the Julia way:
+and-for element-wise arithmetic,*for matrix multiplication and for scaling by a scalar,muladd, broadcasting (.+,exp.(x),ifelse.(...),Float16.(x)) andmap,reduce,mapreduceandaccumulatealong with the derivedsum,prod,maximum,minimum,any,all,count,argmax,argmin,cumsumandcumprod, andreshape,permutedims,transposeanddropdims. Operations with no Julia counterpart keep act.prefix:ct.arange,ct.full,ct.zeros,ct.broadcast_to,ct.extract,ct.catandct.where. ct.gatherandct.scatterindex 1D and 2D arrays with tiles of indices, andct.atomic_cas,ct.atomic_xchgandct.atomic_addperform atomic operations with a configurable memory order and scope.ct.@assertcompiles to a Tile IR assertion, which aborts the kernel when it fails.- Element types follow the Tile IR type system: 8- to 64-bit signed and unsigned
integers,
Float16,BFloat16,Float32,Float64, andTFloat32to feedFloat32data to the tensor cores at reduced precision. Loading the DLFP8Types package additionally makesFloat8_E4M3FNandFloat8_E5M2usable as element types. ct.Constant(value)marks a launch argument whose value should be baked into the code: it generates no kernel parameter, and distinct values compile to distinct kernels. Array arguments are further specialized on anArraySpecthat records pointer alignment, contiguity, and stride and shape divisibility, which the Tile IR compiler uses to select vectorized and TMA-based accesses.code_tiled(f, argtypes)prints the Tile IR for a signature as textual MLIR, and works without a GPU or CUDA.jl.@device_code_tiledand@device_code_structuredprint the Tile IR and the structured Julia IR for every kernel compiled while evaluating an expression.- Requires Julia 1.11, a CUDA 13.1 toolkit and a Blackwell GPU (compute
capability 10.0 or higher).
examples/holds vector addition, transpose, matrix multiplication, batched matrix multiplication, layer normalization and a three-stage Cooley-Tukey FFT, each next to the cuTile Python kernel it was modeled on, plus a script that benchmarks the two against each other.
- cuTile.jl and its dependencies are registered, so the package installs with
Pkg.add("cuTile")instead of a manual clone. - Broadcasting a lower-rank tile against a higher-rank one now pads the shape
with trailing ones, matching Julia's left-aligned broadcast rules:
(64,)broadcasts against(64, 128)along the first dimension. Leading ones were inserted before, which is NumPy's right-aligned convention (#91). ct.atomic_cas,ct.atomic_xchgandct.atomic_addaccept tiles of indices in addition to scalar ones, operating on many elements at once and returning a tile of the previous values. Out-of-bounds indices are masked off (#96).- Kernels can return early from an
if. Such returns are hoisted out of the conditional before code generation, which the Tile IR assembler requires (#92). ct.fullaccepts a runtime value or a 0-D tile, not just a compile-time constant (#100).- Indexing a
TileArraywith scalars (arr[i], useful to read a loop bound from an array) compiles again; the call had gone stale against the intrinsic it uses (#94). BFloat16is supported as a scalar type in kernels, not just as a tile element type (#90).launchdrops every zero-size argument instead of onlyConstant, so any ghost type can be passed to a kernel (#93).
- Added support for CUDA 13.2, which extends Tile IR to Ampere and Ada GPUs:
compute capability 8.0 and higher is now usable, while Blackwell still only
needs CUDA 13.1. Hopper remains unsupported.
launchchecks the toolkit and the device up front and reports what is missing instead of failing further down (#110, #111, #113). - Added host-level broadcast, which uses cuTile without writing a kernel:
wrapping
CuArrays inct.Tiledroutes a broadcast expression through Julia's broadcast machinery into a single generated and launched cuTile kernel.ct.@.is a variant ofBase.@.that wraps every value-position leaf, soct.@. C = A + sin(B)and the allocatingD = ct.@. A + Bwork directly onCuArrays (#129). - Optimization hints can be attached to a kernel from within its body with
ct.@compiler_options num_ctas=... occupancy=... opt_level=..., andct.ByTarget(v"10.0" => 2, v"12.0" => 4; default=1)selects a value per compute capability. The corresponding keyword arguments oflaunchandcode_tiledstill work and take precedence;sm_archnow takes aVersionNumbersuch asv"10.0"instead of a string such as"sm_100"(#122, #111). ct.zerosandct.fullwere removed in favor of overlays onBase, so tiles are constructed withzeros(T, dims),ones(T, dims)andfill(value, dims)the way arrays are.ct.arangealso accepts a plain length, andreshapeaccepts the new dimensions as separate arguments (#123).transposeon a tile is now defined for 1D and 2D tiles only, reshaping a 1D tile to1 × Nand swapping the dimensions of a 2D one; higher ranks throw and should usepermutedims. Thect.transposeintrinsic was removed (#124).sum,prod,maximum,minimum,any,allandcountcan be called withoutdims, reducing over every dimension and returning a scalar.storeaccepts a scalar in place of a tile (#118).- Kernel arguments can be arbitrary isbits structs, which are recursively
flattened into kernel parameters, so a struct holding
TileArrays and scalars can be passed to a kernel and have its fields accessed there. Destructuring used to be specific toTileArray(#128). - The atomic operations convert their value argument to the array's element type, instead of failing with a code generation error when the types differ (#111).
- Shift-left was encoded without its overflow field, which made the assembler
reject kernels using
<<. Bitwise~on integers and!on booleans are supported as well (#106, #107). - Code generation no longer fails with a
MethodErrorwhen the optimizer leaves a bare SSA reference as a statement, and@device_code_tiledworks on kernels takingConstantarguments, which used to report an unsupported Julia type (#125, #127). - A failing Tile IR compilation now reports the assembler's output and keeps the
bytecode around to attach to a bug report, and the assembler is pointed at the
ptxasfrom its own artifact, so aCUDA_ROOTin the environment no longer makes it pick up a mismatched one (#111).