The project
Broad PyTorch support on Apple Silicon
Kernelith is a PrivateUse1 backend built to make Apple Silicon a broad PyTorch compute target instead of supporting only the most common machine learning paths.
The goal is across the board support for everything applicable to Apple hardware that PyTorch supports. That includes normal machine learning workloads, scientific computing, awkward dtypes, complex numbers, sparse layouts, compilation, autograd, and the less common operations that are easy for a backend to ignore.
Release
Currently unreleased
Kernelith is still in development and is not available yet. I plan to release it soon under an open source compatible Business Source License (BSL).
At a glance
Kernelith by the numbers
These structural statistics come from Kernelith's local source tree and generated inventories, refreshed September 4, 2026.
- 2,866
- Backend dispatch entries inventoried
- 2,180
- Native GPU dispatch entries
- 99.8%
- Autograd contract ownership: 2,140 of 2,144 rows
Dispatch entries include ATen, custom, fake, autograd, fallback, and compatibility registrations.
Coverage
PyTorch feature matrix
This is the major end to end capability surface for a general PyTorch backend. It is not a list of every individual operator. The scope is based on the current PyTorch 2.14 documentation and separates dtypes and layouts where partial support can easily be hidden by a broad claim.
Status snapshot: September 4, 2026. Kernelith currently pins PyTorch 2.12, while this matrix also includes newer PyTorch 2.14 surface area. Green means the capability is implemented and tested for the scope described here. Red means it is intentionally skipped, unavailable, or unsupported. Gray means partial, pending, or not yet verified. Green rows are complete for the scope stated in that row. Percentages on gray Partial rows are engineering estimates of usable surface coverage, not test pass rates.
| Capability | PyTorch scope and notes | Kernelith |
|---|---|---|
| Backend foundation | ||
| PrivateUse1 registration | Backend name, device module, generated Tensor and Module methods, and operator registration. | Supported |
| Tensor factories and allocation | Creation through empty, zeros, ones, full, ranges, and like factories directly on the device. | Supported |
| Caching allocator and memory diagnostics | Caching allocation, split and merge behavior, deferred release, memory statistics, snapshots, and out of memory diagnostics. | Supported |
| CPU and device transfers | Copies in both directions, dtype conversion, nonblocking paths where possible, and scalar transfer behavior. | Supported |
| Storage, strides, and views | Dense strided storage, reshape, view, transpose, permutation, slicing, and storage offsets. | Supported |
| Noncontiguous tensors | Correct execution on transposed, sliced, expanded, and otherwise noncontiguous inputs and outputs. | Supported |
| Broadcasting and type promotion | PyTorch broadcasting, scalar handling, mixed dtype promotion, casting, and output dtype rules. Broad coverage is present, with remaining low precision and complex edge combinations. Remaining: Cover the remaining low precision and complex promotion and casting combinations. | Partial (95%) |
| Random generators | Seeded device generation, generator state, reproducibility, and random sampling operators. | Supported |
| Serialization and checkpoints | Saving, loading, map_location handling, state dictionaries, and device remapping. | Supported |
| Streams, events, and synchronization | Asynchronous execution primitives, dependency tracking, explicit synchronization, and timing where the hardware permits them. | Supported |
| Meta and fake tensor behavior | Shape and dtype propagation used by tracing, compilation, export, and operator validation. Upstream ATen coverage and nearly all custom operators are covered, with a small custom surface remaining. Remaining: Add Meta and FakeTensor coverage for the remaining custom schemas. | Partial (98%) |
| Profiler integration | CPU-side operator records are visible, but Metal device timing, memory activity, and trace correlation are not implemented. Remaining: Add Metal device activities, timing, memory events, and trace correlation. | Partial (25%) |
| Dtypes | ||
torch.bool | Boolean tensors and logical, comparison, indexing, masking, and reduction behavior. | Supported |
torch.uint8 | Standard unsigned 8 bit integer dtype. | Supported |
torch.uint16 | Unsigned 16 bit shell dtype with limited eager operator support in PyTorch. | Supported |
torch.uint32 | Unsigned 32 bit shell dtype with limited eager operator support in PyTorch. | Supported |
torch.uint64 | Unsigned 64 bit shell dtype with limited eager operator support in PyTorch. | Supported |
torch.int8 | Signed 8 bit integer tensors. | Supported |
torch.int16 | Signed 16 bit integer tensors. | Supported |
torch.int32 | Signed 32 bit integer tensors. | Supported |
torch.int64 | Signed 64 bit integer tensors and the default integer index dtype. | Supported |
torch.float4_e2m1fn_x2 | Packed container dtype with two 4 bit E2M1 values per byte. Codec and storage foundations exist, but public scaled matrix multiplication integration is not yet correct. Remaining: Correct packed FP4 decode and scale behavior in torch._scaled_mm and verify the public path. | Partial (60%) |
torch.float8_e4m3fn | Container dtype with tested storage, conversion, codec, and scaled matrix multiplication paths. | Supported |
torch.float8_e5m2 | Container dtype with tested storage, conversion, and codec paths. | Supported |
torch.float8_e4m3fnuz | Container dtype with nonstandard NaN and unsigned zero encoding; storage and conversion paths are supported. | Supported |
torch.float8_e5m2fnuz | Container dtype with nonstandard NaN and unsigned zero encoding; storage and conversion paths are supported. | Supported |
torch.float8_e8m0fnu | Unsigned E8M0 container dtype used for microscaling metadata; storage and conversion paths are supported. | Supported |
torch.float16 | IEEE half precision floating point. | Supported |
torch.bfloat16 | Brain floating point with an 8 bit exponent and 7 bit mantissa. | Supported |
torch.float32 | IEEE single precision floating point and PyTorch's default floating dtype. | Supported |
torch.float64 | IEEE double precision through software and host execution policies because Apple GPUs do not provide native float64 arithmetic. Coverage is broad but not universal. Remaining: Expand software and host implementations to the remaining math and linear algebra operations. | Partial (80%) |
torch.complex32 | Complex shell dtype made from two float16 components. Also called torch.chalf. Operator coverage is narrower than for complex64.Remaining: Add the remaining reductions, special math, and linear algebra paths. | Partial (80%) |
torch.bcomplex32 | Complex shell dtype made from two bfloat16 components. It is not available in Kernelith's pinned PyTorch 2.12 baseline. | Unavailable |
torch.complex64 | Complex dtype made from two float32 components. Arithmetic, reductions, FFT, indexing, and most linear algebra work, with remaining linear algebra gaps. Remaining: Close the outstanding complex64 linear algebra overloads and edge cases. | Partial (95%) |
torch.complex128 | Complex dtype made from two float64 components. Storage, movement, and selected host or software math paths work, but operator coverage remains uneven. Remaining: Expand arithmetic, reductions, and linear algebra beyond movement and selected host paths. | Partial (60%) |
| Layouts and memory formats | ||
| Dense strided layout | torch.strided tensors with arbitrary valid sizes, strides, and storage offsets. | Supported |
| Contiguous memory format | Standard dense nonoverlapping storage with decreasing strides. | Supported |
| Channels last 2D | torch.channels_last NHWC memory format for 4D tensors. | Supported |
| Channels last 3D | torch.channels_last_3d NDHWC memory format for 5D tensors. | Supported |
| Sparse COO | Coordinate format, including coalesced and uncoalesced tensors. | Supported |
| Sparse CSR | Compressed sparse row format. | Supported |
| Sparse CSC | Compressed sparse column construction, conversion, and sparse operator dispatch. | Supported |
| Sparse BSR | Block compressed sparse row construction, conversion, and sparse operator dispatch. | Supported |
| Sparse BSC | Block compressed sparse column construction, conversion, and sparse operator dispatch. | Supported |
| Sparse batching and hybrid dimensions | Batched sparse components plus tensors that combine sparse and dense dimensions. | Supported |
| Sparse 2:4 | Semi-structured sparsity is a prototype in PyTorch and stock acceleration is currently CUDA only. | Supported |
| Nested tensors | Classic and jagged nested tensors, including construction, metadata, packed values, padded conversion, operations, autograd, transforms, and jagged attention. | Supported |
| Operator families | ||
| Pointwise arithmetic | Unary and binary arithmetic, powers, remainders, clipping, fused forms, and in-place variants. Remaining: Finish the long-tail dtype, out, and in-place combinations. | Partial (98%) |
| Comparison, logical, and bitwise | Comparisons, finite and NaN checks, boolean logic, and integer bit operations. Remaining: Finish unsigned, complex, and noncontiguous edge combinations. | Partial (98%) |
| Transcendental math | Exponential, logarithmic, trigonometric, hyperbolic, and related functions. Remaining: Complete complex and high precision dtype variants and edge semantics. | Partial (97%) |
| Special functions | torch.special functions including error, gamma, Bessel, softmax, and entropy related operations.Remaining: Implement the remaining long-tail torch.special operations and dtype variants. | Partial (90%) |
| Reductions and statistics | Sum, product, mean, variance, standard deviation, norms, min and max, median, modes, and NaN aware variants. Remaining: Complete complex, float64, named-dimension, and out variants. | Partial (97%) |
| Scans and cumulative operations | Cumulative sum, product, extrema, logsumexp, and related prefix operations. Remaining: Finish the remaining dtype, out, and noncontiguous variants. | Partial (95%) |
| Indexing, slicing, and masking | Basic and advanced indexing, boolean masks, masked selection, take, put, and index assignment. Remaining: Close overlapping, duplicate-index, and unusual-stride corner cases. | Partial (97%) |
| Gather, scatter, and index reduction | Gather, scatter, scatter reduce, index add, index copy, index fill, and index reduce families. Remaining: Complete the remaining reduction modes, dtypes, and layout variants. | Partial (95%) |
| Sorting and searching | Sort, argsort, topk, kthvalue, unique, searchsorted, bucketize, and nonzero. Remaining: Finish long-tail dtype, layout, and out variants. | Partial (95%) |
| Shape and composition operations | Concatenation, stacking, splitting, chunking, reshape, flatten, squeeze, tile, repeat, roll, and permutation. Remaining: Close edge aliasing, overlap, and unusual-stride cases. | Partial (98%) |
| Foreach and fused tensor-list operations | Batched elementwise updates and fused paths used by optimizers and model training. Remaining: Finish the remaining dtype, scalar-list, and in-place variants. | Partial (95%) |
| Matrix and tensor products | Matrix multiply, batched matrix multiply, addmm, einsum, tensordot, inner, outer, and vector products. Remaining: Complete long-tail dtype, broadcasting, and out variants. | Partial (95%) |
| Linear algebra | torch.linalg decompositions, factorizations, solves, inverses, eigenvalues, singular values, ranks, and norms. Broad coverage is present, with remaining complex64 gaps.Remaining: Close the outstanding complex64 decompositions, solves, and out overloads. | Partial (90%) |
| Fast Fourier transforms | torch.fft FFT, inverse FFT, real and Hermitian transforms, multidimensional transforms, and frequency helpers.Remaining: Finish uncommon size, dtype, stride, and transform variants. | Partial (98%) |
| Convolution | 1D, 2D, and 3D convolution, grouped and depthwise convolution, and transposed convolution. Remaining: Complete unusual dtype, layout, and parameter combinations. | Partial (98%) |
| Pooling | Max, average, fractional, Lp, adaptive, and unpooling operations across supported dimensions. Remaining: Close the remaining Lp, fractional, and unpooling edge variants. | Partial (95%) |
| Normalization | Batch, layer, group, instance, local response, RMS, weight, and spectral normalization paths. Remaining: Finish long-tail normalization modes and dtype edge cases. | Partial (95%) |
| Activations | ReLU families, GELU, SiLU, sigmoid, tanh, softmax, gated activations, and other neural nonlinearities. Remaining: Complete the remaining activation, dtype, in-place, and out variants. | Partial (98%) |
| Loss functions | Regression, classification, ranking, embedding, divergence, CTC, and other training losses. Remaining: Finish less common reduction, dtype, and edge-shape combinations. | Partial (95%) |
| Embeddings | Embedding lookup, embedding bags, padding indices, sparse gradients, and renormalization. Remaining: Close sparse-gradient, max-norm, and per-sample-weight edge cases. | Partial (95%) |
| Attention | Scaled dot product attention, masks, causal execution, dropout, grouped query attention, and attention backends. Remaining: Finish uncommon mask, stride, and dtype combinations and specialized backend parity. | Partial (95%) |
| Interpolation and grid sampling | Resize modes, upsampling, affine grids, grid sample, padding modes, and antialiasing paths. Remaining: Complete antialiasing, dtype, layout, and boundary corner cases. | Partial (95%) |
| Random distributions | Uniform, normal, Bernoulli, multinomial, Poisson, exponential, permutation, and distribution sampling. Remaining: Implement the remaining samplers and parameter edge cases. | Partial (90%) |
| Signal processing | torch.signal windows and related signal operations, plus short time Fourier transform paths in the core API.Remaining: Complete the torch.signal window catalog and STFT edge modes. | Partial (85%) |
| Sparse operations | Sparse construction, conversion, elementwise operations, reductions, sampled operations, matrix math, autograd, and COO, compressed, block, hybrid, and semi-structured execution. | Supported |
| Complex operations | Complex arithmetic, conjugation, views, reductions, linear algebra, FFT, and autograd are supported unevenly by dtype and subsystem. Remaining: Finish complex32 and complex128 coverage plus remaining complex64 linear algebra and autograd. | Partial (80%) |
| Container formats and low precision matrix math | FP8, FP6, FP4, integer, NF, subbyte, tensor, channel, and block scaled formats. Format coverage is broad, but public FP4 scaled matrix multiplication remains incomplete. Remaining: Correct public FP4 scaled matrix multiplication and finish format-specific compile and autograd paths. | Partial (90%) |
| Training, transforms, and compilation | ||
| Reverse mode autograd | Backward graphs, saved tensors, accumulation, higher order gradients, and anomaly detection. Remaining: Complete the final direct-owner migrations and edge-case higher-order gradient coverage. | Partial (99%) |
| Forward mode automatic differentiation | Dual tensors and Jacobian vector products through PyTorch forward AD. Remaining: Add JVP rules for the remaining differentiable schemas and dtype or layout edges. | Partial (95%) |
| Complex autograd | Conjugate Wirtinger derivative behavior for real valued losses and complex tensors. Remaining: Broaden higher-order gradients and incomplete complex dtype and linear algebra paths. | Partial (75%) |
| Custom autograd functions | torch.autograd.Function forward, backward, context saving, and transform compatibility. | Supported |
torch.func transforms | Grad, vmap, jacrev, jacfwd, hessian, functional calls, and transform composition. Remaining: Finish batching rules for data-dependent, nested, and remaining custom operations. | Partial (95%) |
| Automatic mixed precision | Autocast policy, eligible operations, custom functions, and gradient scaling. Remaining: Complete the autocast allowlist and low precision training edge cases. | Partial (95%) |
| Optimizers | Single tensor, foreach, and fused optimizer paths where PyTorch exposes them. Remaining: Broaden fused coverage beyond Adam, AdamW, SGD, and Adagrad and close state edge cases. | Partial (85%) |
| Activation checkpointing | Reentrant and nonreentrant checkpoint execution, RNG state handling, and recomputation. | Supported |
torch.compile | Graph capture, fake tensor propagation, graph breaks, compiled autograd, and an executable lowering path. Remaining: Broaden dynamic shapes, close remaining graph breaks, and add missing custom operation lowerings. | Partial (90%) |
torch.export | Basic device graph capture and execution work, but a broader export compatibility contract has not yet been verified. Remaining: Verify symbolic shapes, functionalization, decompositions, and broader model execution. | Partial (40%) |
| Quantized tensor execution | Quantized representations and low precision operators. Current PyTorch documentation directs new quantization work toward torchao. Remaining: Complete FP4 integration and remaining format-specific compile and autograd paths. | Partial (90%) |
| Distributed training integration | Device-native collectives, DistributedDataParallel integration, and multi-process device training are not implemented. | Unsupported |
References