Bayesian optimization is a sequential model-based optimization (SMBO) technique that uses a probabilistic surrogate model, typically a Gaussian Process, to approximate an expensive black-box objective function. It employs an acquisition function, such as Expected Improvement, to intelligently select the next parameter configuration to evaluate, efficiently balancing exploration of uncertain regions with exploitation of known promising areas. This makes it highly effective for auto-tuning NPU kernels where each performance evaluation is costly.
Glossary
Bayesian Optimization

What is Bayesian Optimization?
A sequential, model-based optimization technique for finding the global optimum of expensive-to-evaluate black-box functions, such as NPU kernel performance.
The process iteratively updates the surrogate model with new performance data, refining its predictions of the configuration space. This guided search requires far fewer evaluations than exhaustive or random methods like grid search. In performance profiling and auto-tuning, it is used to optimize parameters like workgroup size, tile size selection, and vectorization factor to minimize latency or maximize compute throughput on specific NPU hardware, directly addressing bottleneck analysis.
Key Components of Bayesian Optimization
Bayesian Optimization is a sequential model-based strategy for finding the global optimum of a black-box function with minimal evaluations. It is particularly effective for auto-tuning NPU kernels where each evaluation (kernel run) is expensive.
Surrogate Model
A probabilistic model (typically a Gaussian Process) that approximates the expensive, black-box objective function. It provides a predictive distribution (mean and variance) over the function's output for any input configuration, quantifying uncertainty where data is sparse. This model is cheap to evaluate and is updated after each observation.
- Primary Role: Acts as a fast, statistical proxy for the costly performance evaluation of an NPU kernel configuration.
- Key Output: For a given parameter set (e.g., tile size, workgroup size), it predicts both the expected performance (mean) and the uncertainty (variance) of that prediction.
Acquisition Function
A utility function that guides the search by quantifying the desirability of evaluating the objective function at a new point. It uses the surrogate model's predictions to balance exploration (sampling high-uncertainty regions) and exploitation (sampling near the current best-known optimum). The next point to evaluate is chosen by maximizing this function.
- Common Functions: Expected Improvement (EI), Upper Confidence Bound (UCB), Probability of Improvement (PoI).
- Decision Engine: Translates the surrogate's statistical predictions into a single, actionable score for selecting the next configuration to test on the NPU.
Observation History
The set of input-output pairs collected from previous evaluations of the expensive black-box function. For NPU auto-tuning, this is the log of tested kernel configurations (e.g., {tile_size: 32, unroll_factor: 4}) and their measured performance metrics (e.g., execution time in microseconds).
- Core Data: This history is the training data for the surrogate model.
- Sequential Nature: The history grows by one pair after each iteration, making the surrogate model progressively more accurate in promising regions of the parameter space.
Optimization Loop
The sequential process that iteratively refines the search for the optimum. Each cycle consists of:
- Fit/Update the surrogate model using the current observation history.
- Maximize the acquisition function to propose the next most promising parameter configuration.
- Evaluate the proposed configuration by running the kernel on the NPU and measuring its performance (the expensive step).
- Augment the observation history with the new result.
The loop terminates based on a budget (e.g., max evaluations) or convergence criteria.
Configuration Space
The domain of tunable parameters defining all possible kernel configurations to be searched. This is the input space for the objective function. For an NPU kernel, this space is defined by discrete and/or continuous parameters.
- Examples: Thread block dimensions (
blockDimX,blockDimY), loop unroll factors, memory tile sizes, vectorization width. - Definition: Must be carefully bounded and structured. It can be categorical (e.g., use algorithm A or B), integer (e.g., tile size from 16 to 128), or continuous (e.g., a learning rate). The surrogate model must be able to model this space.
Objective Function
The expensive black-box function being optimized. In NPU auto-tuning, this is the performance evaluation process for a given kernel configuration. It takes a point from the configuration space as input, runs the kernel with those parameters on the target hardware, and returns a scalar performance metric.
- Typical Form:
f(config) -> performance_metric(e.g., execution time, throughput, energy efficiency). - Key Characteristics: It is noisy (measurements can vary), derivative-free (gradients are unavailable), and costly to evaluate (each run consumes time and energy on the NPU). The goal of Bayesian Optimization is to find its minimum or maximum with as few calls as possible.
Frequently Asked Questions
Bayesian Optimization is a core technique in the auto-tuning of computational kernels for Neural Processing Units. This FAQ addresses its core mechanisms, applications, and relationship to other profiling and tuning methodologies.
Bayesian Optimization is a sequential, model-based global optimization strategy designed to find the minimum or maximum of an expensive-to-evaluate black-box function. It operates by constructing a probabilistic surrogate model (typically a Gaussian Process) to approximate the unknown function and an acquisition function to decide where to sample next, efficiently balancing exploration of uncertain regions and exploitation of known promising areas.
Core Mechanism:
- Build a Surrogate Model: A Gaussian Process (GP) is fitted to the observed (parameter, performance) pairs. The GP provides a predictive distribution (mean and variance) for the performance of any untested parameter configuration.
- Optimize the Acquisition Function: An acquisition function (e.g., Expected Improvement, Upper Confidence Bound) uses the GP's predictions to quantify the potential utility of evaluating a new point. It formalizes the explore/exploit trade-off.
- Evaluate the Black-Box Function: The parameter set that maximizes the acquisition function is selected and evaluated on the actual, expensive system (e.g., running a kernel on the NPU to measure execution time).
- Update and Repeat: The new observation is added to the dataset, the GP model is updated, and the process repeats until a budget (evaluation count) is exhausted.
In NPU auto-tuning, the black-box function is the kernel's execution time or throughput, and the parameters are tunable compiler options like workgroup size, tile size, or vectorization factor.
Bayesian Optimization vs. Other Search Methods
This table contrasts the core characteristics of Bayesian Optimization with other common parameter search techniques used in NPU kernel auto-tuning and hyperparameter optimization.
| Feature / Metric | Bayesian Optimization | Grid Search | Random Search | Gradient-Based Optimization |
|---|---|---|---|---|
Core Search Strategy | Probabilistic model-guided (exploration/exploitation) | Exhaustive over a predefined grid | Uniform random sampling | Gradient descent/ascent on a differentiable surface |
Sample Efficiency (Evaluations to Optimum) | High | Very Low | Low | Varies (High if differentiable) |
Handles Non-Differentiable Objectives? | ||||
Handles Noisy Evaluations? | ||||
Explicitly Models Uncertainty? | ||||
Parallel Evaluation Support | Limited (requires model update) | Full (embarrassingly parallel) | Full (embarrassingly parallel) | Limited (requires sequential gradient steps) |
Scalability to High Dimensions (>20 params) | Moderate (surrogate model complexity) | Very Poor (curse of dimensionality) | Poor (uniform sampling becomes sparse) | Good (if gradients are available) |
Typical Use Case in Auto-Tuning | Expensive black-box functions (e.g., kernel runtime) | Small, discrete parameter spaces | Initial broad exploration | Tuning differentiable hyperparameters (e.g., learning rate schedules) |
Overhead per Iteration | High (model fitting & acquisition optimization) | None | None | Moderate (gradient computation) |
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
Bayesian Optimization is a core technique within the auto-tuning workflow. These related concepts define the search space, measurement tools, and performance models it operates on.
Auto-Tuning
The automated process of searching a configuration space to find the optimal set of parameters (e.g., tile size, workgroup size) for a computational kernel on specific hardware. It replaces manual trial-and-error with systematic search algorithms like Bayesian Optimization.
- Goal: Maximize a performance metric like throughput or minimize latency.
- Process: Iteratively runs kernel variants, measures results, and uses a surrogate model to guide the next test.
Performance Model
An analytical or machine-learned model that predicts the execution time or resource usage of a computational kernel. In Bayesian Optimization, this is the probabilistic surrogate model (like a Gaussian Process) that guides the search.
- Analytical Models: Use first-principles of hardware (e.g., roofline model) to estimate bounds.
- Surrogate Models: Learn the relationship between kernel parameters and performance from empirical data, quantifying prediction uncertainty.
Configuration Space
The set of all possible combinations of tunable parameters that define the search domain for an auto-tuning process. For an NPU kernel, this often includes:
- Workgroup/Thread Block Size
- Loop Unrolling Factor
- Tile Size for memory hierarchies
- Vectorization Factor
The efficiency of Bayesian Optimization depends on a well-defined, constrained space to avoid combinatorial explosion.
Kernel Profiler
A software tool that measures the execution characteristics of a computational kernel. It provides the empirical data (the objective function) that Bayesian Optimization seeks to optimize.
- Metrics Collected: Execution time (latency), compute throughput (FLOPS), memory bandwidth utilization, and hardware performance counter events (e.g., cache misses).
- Types: Sampling profilers (low overhead) and instrumentation profilers (high precision).
Acquisition Function
The decision-making component of Bayesian Optimization that uses the probabilistic surrogate model to select the next parameter set to evaluate. It formalizes the exploration-exploitation trade-off.
- Expected Improvement (EI): Favors points likely to outperform the current best.
- Upper Confidence Bound (UCB): Balitates the predicted mean and its uncertainty.
- Probability of Improvement (PI): Focuses on the chance of simple improvement.
Surrogate Model
A probabilistic model used to approximate the expensive-to-evaluate objective function (e.g., kernel runtime). Bayesian Optimization uses it to reason about unseen configurations.
- Gaussian Process (GP): A common choice that provides a mean prediction and a measure of uncertainty (variance) for any point in the configuration space.
- Tree-structured Parzen Estimator (TPE): Often used in hyperparameter tuning tools like Hyperopt.
- Random Forest: Can also be used as a probabilistic surrogate.

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