Tile size selection is the process of choosing the dimensions of data blocks (tiles) used in loop tiling transformations to optimize for cache locality and parallelism in NPU kernels. The selected tile dimensions directly control how data is partitioned and staged through the NPU's memory hierarchy, balancing the reuse of data in fast scratchpad memory or caches against the overhead of data movement and synchronization. An optimal tile size maximizes data reuse within a compute unit while fitting within limited on-chip memory resources.
Glossary
Tile Size Selection

What is Tile Size Selection?
Tile size selection is a critical compiler optimization for neural processing units (NPUs) that determines the dimensions of data blocks processed in on-chip memory.
This parameter is a primary target for auto-tuning frameworks, which systematically search the configuration space of possible tile dimensions to find the setup that yields peak compute throughput and minimizes memory bandwidth pressure. The selection is hardware-specific, depending on the NPU's cache sizes, memory bus width, and parallel execution capabilities. Poor tile size selection can leave the NPU memory-bound or underutilized, while optimal selection ensures computational units are fed data efficiently, directly impacting kernel execution latency and overall system performance.
Key Objectives of Tile Size Selection
Tile size selection is a critical compiler optimization that partitions loop iterations into smaller blocks to maximize data reuse and parallel execution. The primary objectives are to orchestrate data movement and computation for peak hardware efficiency.
Maximize Cache Locality
The foremost goal is to ensure the data accessed within a tile fits within the target cache level (e.g., L1, shared memory). This minimizes expensive accesses to slower, higher-level memory (e.g., global memory, DRAM).
- Temporal Locality: Data loaded into the cache is reused multiple times by computations within the tile before being evicted.
- Spatial Locality: The tile dimensions are chosen so that consecutive memory accesses are to adjacent addresses, enabling efficient memory coalescing.
- Objective: Select a tile size where the working set (input, output, and intermediate data) does not exceed the cache capacity, preventing capacity misses.
Optimize Parallel Execution
Tile dimensions directly map to the parallel execution resources of an NPU, such as its cores, warps, or vector units. The size must align with hardware constraints to achieve full occupancy.
- Workgroup Mapping: The tile is often assigned to a thread block or workgroup. The tile size (e.g., 128x128 elements) must be divisible by the workgroup size (e.g., 256 threads) to ensure balanced load distribution.
- Reducing Synchronization: Larger tiles can reduce the frequency of global synchronization points between parallel units, but may increase register pressure.
- Objective: Choose tile dimensions that saturate the NPU's parallel compute units without causing resource contention or thread divergence.
Balance Compute and Memory Bound
Tile size is a primary lever to shift a kernel from being memory-bound to compute-bound. The ideal size increases the arithmetic intensity (operations per byte of data moved) within the tile.
- Memory-Bound Scenario: Small tiles result in high overhead from frequent data movement, leaving compute units idle.
- Compute-Bound Scenario: Larger tiles increase the number of operations performed on data while it resides in fast cache, better utilizing the ALUs.
- Objective: Find the tile size that maximizes the ratio of compute operations to memory transactions, moving the workload closer to the hardware's peak compute throughput.
Minimize Memory Traffic
Effective tiling reduces the total volume of data transferred between memory hierarchy levels. This directly lowers execution time and power consumption.
- Redundant Load Elimination: By reusing data within a tile, the same memory address is not fetched multiple times from slow memory.
- Granularity Optimization: Tile dimensions are chosen to match the NPU's burst transaction size or cache line length, ensuring full utilization of each memory transfer.
- Objective: Select tile dimensions that minimize the total bytes read/written to global memory per computation, thereby reducing pressure on memory bandwidth.
Define a Searchable Configuration Space
Tile size parameters (e.g., TILE_M, TILE_N, TILE_K for matrix multiplication) form the core dimensions of the configuration space explored by an auto-tuner.
- Discrete Parameters: Tile sizes are typically powers of two or multiples of hardware-specific dimensions (e.g., vector width), creating a finite but large search space.
- Performance Modeling: The relationship between tile size and performance (latency, throughput) is complex and non-linear, making empirical auto-tuning or Bayesian optimization necessary.
- Objective: Establish a logical, constrained parameter space that a kernel tuner can efficiently navigate to find the globally optimal configuration for a given NPU and kernel.
Manage On-Chip Memory Resources
Tile data must be staged in fast, but limited, on-chip memories like scratchpad SRAM or registers. Tile size selection is a direct trade-off between these resources.
- Register File Pressure: Larger tiles or more complex operations per element may require more registers per thread, potentially reducing occupancy if the register file is exhausted.
- Shared Memory Allocation: Tiles are often staged in software-managed cache (shared memory). The tile size must fit within the allocated shared memory budget per thread block.
- Objective: Choose tile dimensions that optimally partition the available on-chip memory between registers and shared memory to avoid pipeline stalls due to resource limits.
Factors Influencing Tile Size Selection
Key hardware and algorithmic factors that determine the optimal tile dimensions for loop tiling in NPU kernels.
| Factor / Metric | Small Tile Size | Medium Tile Size | Large Tile Size |
|---|---|---|---|
Cache Hit Rate (L1/L2) | High (fits entirely in cache) | Moderate (partial reuse) | Low (may exceed cache capacity) |
Memory Bandwidth Pressure | Low (frequent reuse of loaded data) | Moderate | High (less reuse per load) |
Parallelism (Occupancy) | High (many small tiles can be scheduled) | Balanced | Low (fewer, larger concurrent tiles) |
Register Pressure per Thread | Low | Moderate | High (more data per thread) |
Synchronization Overhead | High (more frequent barrier calls) | Moderate | Low |
Data Transfer Overlap Potential | High (small transfers hide latency) | Moderate | Low (large transfers cause stalls) |
Suitability for Problem | Irregular access patterns, small working sets | General-purpose, balanced workloads | Regular, compute-heavy kernels with large data reuse |
Frequently Asked Questions
Tile size selection is a critical loop transformation for optimizing data locality and parallelism on Neural Processing Units (NPUs). These questions address the core concepts, trade-offs, and methodologies involved in this key performance tuning process.
Tile size selection is the process of determining the optimal dimensions for sub-blocks of data (tiles) when applying loop tiling (or loop blocking) to a computational kernel, specifically to maximize performance on a Neural Processing Unit (NPU). The goal is to transform a large iteration space into smaller blocks that fit within the NPU's memory hierarchy—such as shared memory or local caches—to reduce expensive accesses to slower global memory. By carefully choosing the tile's height and width, you can dramatically improve cache locality, enable more efficient memory coalescing, and expose higher levels of parallelism for the NPU's execution units. This is a fundamental hardware-aware model optimization that directly impacts compute throughput and whether a kernel is compute bound or memory bound.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Tile size selection is a core optimization within a broader ecosystem of techniques for maximizing NPU efficiency. These related concepts define the parameters, constraints, and methodologies used to find the optimal configuration.
Loop Tiling
The foundational compiler transformation that introduces tile size selection. It partitions loop iterations into smaller blocks (tiles) to fit data into faster levels of the memory hierarchy.
- Goal: Improve cache locality by reusing data within a tile before it is evicted.
- Mechanism: Adds outer loops that stride by the tile size and inner loops that iterate within the tile.
- Trade-off: Larger tiles increase reuse but may exceed cache capacity, causing thrashing.
Memory Bound vs. Compute Bound
The two fundamental performance states that dictate tile size strategy. A kernel is memory-bound if its speed is limited by memory bandwidth, or compute-bound if limited by arithmetic throughput.
- Memory-Bound Kernels: Benefit from tile sizes that maximize data reuse to reduce pressure on the memory subsystem.
- Compute-Bound Kernels: May prioritize tile sizes that maximize occupancy and hide ALU latency.
- Analysis: Profiling metrics like achieved memory bandwidth vs. peak FLOPS determine the bound.
Cache Hit Rate
The percentage of memory requests served from cache (L1, L2) versus slower main memory. It is the primary quantitative metric influenced by tile size selection.
- Direct Impact: Well-chosen tile sizes keep working sets within cache, leading to hit rates >90%.
- Measurement: Tracked via hardware performance counters (e.g.,
l1_cache_hit,l2_cache_miss). - Objective: Increase hit rate to reduce the effective latency and energy cost of memory accesses.
Configuration Space
The multidimensional search domain defined by all tunable parameters for a kernel, with tile size dimensions being a primary axis.
- Dimensions: Includes workgroup size, loop unroll factors, vectorization factors, and memory promotion flags.
- Size: Can be vast (e.g., 10⁶+ combinations), necessitating intelligent search.
- Constraint: Parameters are often interdependent; optimizing tile size may require adjusting workgroup size.
Performance Model
An analytical or machine-learned function that predicts execution time based on kernel parameters and hardware specs. It guides tile size selection without exhaustive search.
- Analytical Models: Use roofline analysis, calculating operational intensity and bandwidth limits.
- ML-Based Models: Trained on profiling data to predict latency for unseen configurations.
- Use Case: Filters the configuration space, identifying promising tile size regions for empirical testing.
Auto-Tuning
The automated process of searching the configuration space to find optimal parameters, including tile sizes. It replaces manual heuristic-based selection.
- Methods: Include exhaustive search, random search, genetic algorithms, and Bayesian optimization.
- Tools: Frameworks like AutoTVM, Ansor, and Triton's autotuner automate this for NPU/GPU kernels.
- Output: A set of tuned parameters (e.g.,
tile_x=128, tile_y=64) for a specific hardware target.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us