Performance measurement · Research feature

Nautilus: An Auto-Scheduling Tensor Compiler for Efficient Tiled GPU Kernels

Results show Nautilus achieves up to 23% higher throughput on GH200 and up to 42% on RTX 5090 compared to state-of-the-art compilers, matching or exceeding manually crafted cuDNN kernels in long-sequence scenarios.

Adapted from research by Yifan Zhao, Yuchen Yang, Matei Budiu and colleagues.

arXiv preprint revision · 2026-04-16 · Attribution & reuse
In this article
Editorial illustration of processor die.

Editor’s introduction

Nautilus is a tensor compiler that automatically converts algebraic descriptions of tensor operations into optimized tiled GPU kernels. The system’s auto-scheduler discovers complex optimization sequences, including advanced reduction fusion, while preserving the structural regularity needed for tile-based execution. Results show Nautilus achieves up to 23% higher throughput on GH200 and up to 42% on RTX 5090 compared to state-of-the-art compilers, matching or exceeding manually crafted cuDNN kernels in long-sequence scenarios. The study evaluates performance across five transformer models and 150 configurations, demonstrating consistent gains. A boundary of the evidence is that performance comparisons with Neptune are limited by Triton’s code generation capabilities, which struggle with efficient backend output on Hopper and Blackwell architectures, indicating that the compiler’s schedule quality is already competitive with manual designs, but hardware-specific code generation remains a bottleneck.

Introduction

Modern attention-based machine learning (ML) models are essential for language, vision, and other emerging tasks in artificial intelligence. To efficiently deploy these models on GPUs, system engineers need tools to bridge the performance gap between a math-like model specification, such as PyTorch or JAX code, and efficient low-level code that maximally utilizes the underlying hardware. Today, the connection between math-like specification and efficient execution on increasingly varied hardware is challenged — existing tools are either too hard to use, requiring expertise in rapidly-evolving low-level hardware details, or produce programs that are not sufficiently performant.

The most common approach today is writing manually optimized kernels in hardware vendor languages like CUDA and CUTLASS. They achieve high performance and have been used in PyTorch and TensorFlow. However, programming in these low-level languages requires significant hardware and algorithmic expertise and does not scale to rapidly evolving GPU architectures and ML models. On the opposite side, schedule-based tensor compilers such as Halide and TVM optimize a high-level specification of the ML operator in a math-like tensor language. This design offloads the obligation of optimization from the programmer to the compiler, which needs to search in a complex design space of schedules (sequence of transformations) to find an optimal kernel on the target GPU. But, an unconstrained, exhaustive search in this design space is intractable, thus today’s high-level tensor compilers fail to match the performance of handwritten code.

As a tentative trade-off between programmability and efficiency, tile-based compilers and languages, including Triton, Pallas, and TileLang, have emerged as an abstraction layer over hardware vendor languages. Here, a programmer manually expresses the ML operator as computation over tiles (fixed size subtensors), and the tile compiler applies low-level SIMD optimizations to map tile computation to the hardware. With tile languages, a programmer still has to manually control many essential high-level optimizations, making it difficult to write and port to new hardware. This issue is especially evident for attention, where multiple versions of FlashAttention require high-level optimizations that tile compilers cannot automate. Programmers then need to manually write increasingly more complex tile programs to implement those kernels and significantly modify them for every new GPU architecture.

We advocate that a math-to-kernel compiler is a viable solution that can yield ML kernel efficiency competitive with manually-written code on modern GPU architectures. The programmer should be able to write operators in a math-like linear algebraic language (e.g., attention as a sequence of matmuls and softmax), and the compiler automatically finds high-performance kernels (e.g., FlashAttention). The central difficulty to materialize this goal is that we must bridge two types of optimizations that live on different levels of abstraction: (1) operation-level optimizations that reason about compute expressions and data dependencies of linear algebra operations, and (2) tile optimizations that map regular computation patterns to the underlying hardware.

While tile compilers are effective low-level optimizers, they are suboptimal programming interfaces as they fail to automate operation-level optimizations. First, compiling many tensor operations into one or a few efficient kernels requires new fusion techniques to handle complex data dependency. In particular, advanced reduction fusion can fuse reduction loop nests, such as softmax and matmul in attention, and it is a key optimization to allow compilers to automatically discover FlashAttention from math-like attention. Yet it is still unclear how to apply such optimizations in a compiler without user intervention. Second, a rigorous translation pipeline and stable intermediate representations (IRs) are needed to bring the program from math expressions to a kernel, while facilitating optimizations at different abstraction levels.

Our work: Nautilus. Nautilus is a novel tensor-compiler for attention-based ML models. Nautilus brings together a variety of optimizations: operation-level optimizations (advanced reduction fusion), expression rewrites, and tile optimizations in one pipeline, to generate high-performance GPU kernels on modern and emerging GPUs. These categories of optimizations live on very different abstraction levels. This work is the first to identify these three categories as critical stages in end-to-end tensor compilation, and provide a successively lowering pipeline where each IR is at the right abstraction level to facilitate a category of optimizations.

Background

Schedule-based Tensor Optimizations. Schedule-based tensor compilers (e.g., TVM and Halide ) separate the mathematical definition of a tensor program from optimization decisions. Optimization decisions are conveyed via dedicated scheduling languages, with a library of program transformations, e.g., for loops, parallelization, and data movement. Auto-schedulers (e.g., Ansor and Halide’s auto-scheduler ) aim to relieve users from hand-writing schedules by searching over the space of legal transformation sequences. They rely on heuristic rules and cost models to prune unfavorable schedules. The design of schedule languages adds to the difficulty of auto-scheduling: they tend to expose a set of fine-grained transformations and mix optimizations from different levels (e.g., high-level fusion decisions with low-level thread mappings) in a single schedule.

Tile Optimizations. Tile-based compilers (e.g., Triton and TileLang ) are an alternative approach to effectively automate low-level optimizations. Programmers describe the workload as tile computation (fixed-shape subtensors) in a tile-based language with an SIMD-like programming model, and the compiler maps the tiles to hardware SIMD units. While tile compilers automate SIMD-level optimizations, they leave most higher-level optimizations, e.g., operator fusion and expression rewriting, to the programmer.

Bridging Schedule and Tile Optimizations. Prior work (e.g., Neptune ) has shown that schedule-based and tile-based approaches are complementary and can combine to achieve higher performance than either. Schedule languages are well-suited for high-level optimizations such as operator fusion, and tile compilers excel at low-level mapping of tile programs to hardware. Neptune proposes a unified framework where scheduling acts on loop-based programs (loop-scalar IR in Neptune), which Neptune translates into a tile-based representation (tile IR) to exploit Triton for SIMD optimizations. Neptune still requires major manual effort to use, as it does not include an auto-scheduler and requires the user to provide a schedule. As Neptune only targets Triton as its optimizer, it cannot make use of features on newer GPUs such as asynchronous tensor core matmul, and delivers subpar performance compared to newer kernel libraries.

Tensor Operator Fusion. In GPU kernels, multiple outermost loops execute in parallel across different GPU thread blocks. Combining compute operations under the same parallel loops can bring significant performance benefit, since it reduces data communication across thread blocks. This technique is called operator fusion. Operator fusion is not always possible for computation with complex data dependency patterns. Neptune generalizes operator fusion to support fusing multiple reduction operations, and provides them as program transformation passes that Nautilus uses.

Data Localization

Data localization optimizations place data tensors on an inner (more local) memory level (e.g. shared memory and registers compared to global) with the goal of reducing slow global memory traffic. Initially, all tensors are located in global memory before this set of optimizations applies. The auto-scheduler performs two types of data localization: (1) it creates a copy of a tensor to a more local memory level if the loop nest exhibits temporal reuse of this buffer (i.e., it is expected this copy will be accessed many times), and (2) it replaces the tensor in an inner memory level if all tensor accesses are local to a thread block.

The auto-scheduler combines both data localization strategies with an analysis that considers the capacity of a memory level, as inner memory levels (such as shared memory) are often smaller. Tensors which have a long lifetime and are large in size may cause additional memory pressure on local memory. Our auto-scheduler performs tensor lifetime and size analysis to identify large buffers with long live ranges that would otherwise occupy scarce local memory. For buffers that are read multiple times and are inexpensive to recompute, we apply rematerialization and live-range splitting, recomputing the buffer near each use to reduce memory pressure and improve occupancy.

Nautilus’s Successive Lowering Pipeline

Our optimization pipeline takes an input program and successively lowers it through a scalar IR and two tile IRs. While these types of IRs are commonly used in tensor compilers, one of the two tile IRs in Nautilus is unique: the virtual register tile IR (VR-tile IR), necessitated by the need for expression rewriting at tile level. The other tile IR in Nautilus, the memory access tile IR (MA-tile IR), enables tile optimization. It is purposefully similar to the tile IRs that many tile compilers use, simplifying interfacing with existing tile optimizers.

Tile Optimizations. Nautilus’s MA-tile IR is the language where tile optimizations happen. It builds on the tile IR of Neptune, which Neptune uses to apply tile optimizations from Triton. In Nautilus, we design the MA-tile IR as a super set of multiple existing tile languages, which enables Nautilus to use multiple tile optimizers: Triton, Tawa, and TileLang. The auto-scheduler includes the choice of tile optimizer as part of the schedule (retained on the program during lowering), and selects the best-performing tile optimizer for the input program and target hardware. MA-tile contains plain for-loops and exposes tile load/store information, which tile optimizers require to perform SIMD optimizations. After expression rewriting, Nautilus translates the program from the VR-tile IR into the MA-tile IR, by desugaring the loop expression and tile-valued virtual registers in the VR-tile IR.

Implementation

Nautilus reuses components from TVM, Neptune, and multiple tile-based compilers. We use TVM’s tensor expression (TE) language as the input format of Nautilus to describe the input tensor program. The scheduling language uses infrastructure from TVM’s scheduling language for TensorIR. The scalar IR, where scheduling happens, and the memory access tile IR are adapted from Neptune. Including VR-tile IR which is a Nautilus creation, the implementations of all three IRs use TVM TensorIR code infrastructure as a foundation.

For the Nautilus auto-scheduler, we developed a custom design-space generator to create our pre-order pass traversal. We implement each of our passes as a TVM MetaSchedule rule which is fed to this design space generator. The auto-scheduler uses an evolutionary search algorithm with a learned cost model. For each schedule seed, it generates different schedules by varying tunable parameters. It then predicts the performance of each schedule with the cost model, and runs the projected-best schedules on the target GPU. The auto-tuning budget of Nautilus’s auto-scheduler is measured by the number of empirical GPU measurements.

Nautilus has three tile-based compilers as back-ends and tile optimizers: Triton, Tawa, and TileLang. The auto-scheduler includes the choice of tile optimizer as part of the schedule, and selects the best-performing tile optimizer for the input program and target hardware. Nautilus provides translators from its MA-tile IR to the tile-based language of each compiler, and a runtime that manages kernel compilation, caching, and invocation through a unified interface.

Experimental Methodology

Baselines. We compare Nautilus to a comprehensive set of 12 baselines listed here, with underscores marking the names we refer to them. Our baselines include six tensor compilers: Tawa 3.3, TileLang 0.1.8, Triton 3.6.0, Helion 0.3.1, FlexAttention (FlexAttn) in PyTorch 2.11.0, and TVM 0.18. Triton, Tawa, and TileLang are tile-based compilers. We use the stock attention implementation for Tawa and TileLang, and two mainstream implementations for Triton: OpenAI Triton and Tri-Dao Triton. We compare five optimized kernel libraries and header-only libraries: ThunderKittens (obtained from TK authors), PyTorch 2.11.0, cuDNN 9.11.0, Tri-Dao 2.8.3 (Dao-AILab’s CUTLASS implementation), and FlashInfer 0.6.7. Each baseline supports a subset of the setups we evaluate. For PyTorch and FlexAttn, we use compile(mode=‘max-autotune’, backend=‘inductor’) for high performance. For Tawa and TileLang, we use implementations following the FlashAttention-3 strategy. We do not evaluate FlashAttention-4 because it includes approximation techniques that are outside the scope of our exact-attention evaluation.

LLM Inference Frameworks. A large body of work focuses on large language model (LLM) inference and serving, including vLLM, DeepSpeed Inference, NVIDIA FasterTransformer, and TensorRT-LLM. These systems primarily optimize at model and higher levels with techniques like KV-cache management and request scheduling. They typically do not provide their own kernels and rely on kernel libraries to back the underlying tensor computation. Nautilus is a tensor compiler that automatically generates high-performance kernels and integrates them into DNN inference pipelines. Therefore, Nautilus is complementary to these LLM-serving frameworks and can serve as a backend that supplies high-performance kernels, with performance and portability beyond what fixed library kernels can provide.

Tile-based Programming Frameworks. Tile languages like Triton, TileLang, cuTile, and others produces optimized mapping of tiles to warps and threads. Tile languages are a low-level abstraction that leaves higher-level optimizations, such as operator fusion and expression rewriting, on the table for programmers. Nautilus automates these high-level optimizations via auto-scheduling, delegates tile optimizations to multiple tile compilers (Triton, Tawa, and TileLang), and chooses between tile compilers dynamically based on performance. Nautilus is integrated with Triton, Tawa, and TileLang, showing that its principle is general and can be applied to other tile compilers.

Scheduling Tensor Compilers and Auto-Schedulers. Schedule-based tensor compilers such as Halide, TVM, AKG, and Tiramisu, separate algorithm from optimization decisions (“schedule”). Neptune limits the schedule search space by delegating low-level optimization to tile optimizers. Auto-scheduling frameworks like Ansor, MetaSchedule, and FlexTensor automate schedule generation and free users from manually supplying schedules. Nautilus’s novel scheduling language adapts to the optimization needs of modern GPUs, and its novel auto-scheduler overcomes the challenges of complex graph-level scheduling comprising advanced fusion strategies.

Super-optimizing Tensor Compilers. Super-optimizing compilers such as TASO and Mirage transforms the given tensor program in ways that may not preserve semantic equivalence, and impose additional checks to select correct implementations. As an instance, Mirage is a hierarchical super-optimizer that jointly transforms the program at thread, tile, and operator levels. Mirage super-optimization produces a search space where search can take minutes to hours even with pruning. Mirage uses a probabilistic correctness test, producing kernels that are potentially unsound, contrasting with Nautilus’s guaranteed correctness.

Pytorch-Based FlashAttention. Recently, Flashlight introduces a semantic fusion pass on top of the PyTorch TorchInductor compiler to generate FlashAttention-style fused kernels from PyTorch attention definition. The main optimizations Flashlight supports are semantic fusion and limited tiling, which are a set of graph rewrite rules specific to the TorchInductor IR. Unlike Flashlight, which performs a limited set of optimizations and must generate Triton kernels as it is bound to the PyTorch infrastructure, Nautilus provides a comprehensive optimization framework through its unique three-IR architecture. Nautilus combines operation-level optimizations, expression rewrites, and tile optimization in one pipeline, and selects from multiple tile optimizers based on performance. Flashlight is not available as open-source and we could not experimentally compare the results.

Graph- and Model-level Optimizations. Graph compilers and model-level optimizers such as XLA, Glow, BladeDISC, and TASO focus on optimizing entire computation graphs. They perform operator fusion, layout transformation, and device placement, then lower subgraphs to code generators or libraries. These systems often skip over kernel-level optimizations, relying on a separate kernel generator for the final code. Nautilus captures operator fusion as one of the most important graph-level optimizations, and integrates it with kernel-level optimizations, enabling their joint optimization in the space of schedules.

Conclusion

We have presented Nautilus, a fully-automated GPU kernel compiler with a novel auto-scheduler that supports advanced operator fusion. And Nautilus presents a sequence of lowering IRs that enables to automatically deploy tile-based frameworks as backends. Nautilus-generated attention kernels show up to 23% improvement over state-of-the-art compiler systems on NVIDIA GH200 and up to 42% on NVIDIA RTX 5090. As hardware grows more complex and exposes more features to software, we believe compilers which do the heavy optimization work like Nautilus grow increasingly critical for enabling broader progress on these platforms.