<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Inference optimization on AI Tools</title>
    <link>https://ait.bsc.es/handbook/inference-optimization/</link>
    <description>Recent content in Inference optimization on AI Tools</description>
    <generator>Hugo</generator>
    <language>en</language>
    <atom:link href="https://ait.bsc.es/handbook/inference-optimization/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>LLM performance benchmarks</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/llm-performance-benchmarks/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/llm-performance-benchmarks/</guid>
      <description>&lt;p&gt;Most published inference numbers are not reproducible in your environment, because they&#xA;encode a traffic pattern, a hardware configuration and a measurement methodology that&#xA;are not yours.&lt;/p&gt;&#xA;&lt;p&gt;This page covers how to benchmark your own deployment in a way that supports capacity&#xA;and configuration decisions.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Which workload parameters must be specified for a benchmark to mean anything.&lt;/li&gt;&#xA;&lt;li&gt;How to model a realistic request arrival pattern.&lt;/li&gt;&#xA;&lt;li&gt;Why steady-state and cold-start measurements differ.&lt;/li&gt;&#xA;&lt;li&gt;How to report results so others can reproduce them.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Static, dynamic and continuous batching</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/batching/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/batching/</guid>
      <description>&lt;p&gt;Batching amortises the cost of moving weights through the accelerator across multiple&#xA;requests. How requests are grouped determines both achievable throughput and the latency&#xA;individual requests experience.&lt;/p&gt;&#xA;&lt;p&gt;This page compares the three main strategies and explains the shift toward continuous&#xA;batching.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why batching improves accelerator utilization at all.&lt;/li&gt;&#xA;&lt;li&gt;How static, dynamic and continuous batching differ.&lt;/li&gt;&#xA;&lt;li&gt;Why variable-length generation penalises static batching so heavily.&lt;/li&gt;&#xA;&lt;li&gt;How batching configuration trades throughput against tail latency.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PagedAttention</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/paged-attention/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/paged-attention/</guid>
      <description>&lt;p&gt;Naively allocating a contiguous KV cache block per request wastes a large fraction of&#xA;accelerator memory, because allocations must be sized for the longest possible output&#xA;rather than the actual one.&lt;/p&gt;&#xA;&lt;p&gt;PagedAttention applies the idea behind virtual memory paging to the KV cache, trading a&#xA;level of indirection for substantially better memory utilization.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why contiguous KV cache allocation fragments memory.&lt;/li&gt;&#xA;&lt;li&gt;How paging the KV cache into fixed-size blocks addresses that.&lt;/li&gt;&#xA;&lt;li&gt;How paging enables sharing between requests with common prefixes.&lt;/li&gt;&#xA;&lt;li&gt;What the indirection costs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Speculative decoding</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/speculative-decoding/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/speculative-decoding/</guid>
      <description>&lt;p&gt;Decoding is limited by memory bandwidth rather than compute, so a forward pass that&#xA;verifies several candidate tokens costs little more than one that produces a single&#xA;token. Speculative decoding exploits that.&lt;/p&gt;&#xA;&lt;p&gt;This page explains the mechanism and the conditions under which it actually pays off.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why verifying several tokens costs little more than generating one.&lt;/li&gt;&#xA;&lt;li&gt;How draft-and-verify preserves the target model&amp;rsquo;s output distribution.&lt;/li&gt;&#xA;&lt;li&gt;Which draft model choices work, including model-free variants.&lt;/li&gt;&#xA;&lt;li&gt;When speculative decoding fails to help or hurts.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Prefill-decode disaggregation</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/prefill-decode-disaggregation/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/prefill-decode-disaggregation/</guid>
      <description>&lt;p&gt;Prefill is compute-bound and decode is bandwidth-bound. Running both on the same replica&#xA;means one phase&amp;rsquo;s requirements always compromise the other&amp;rsquo;s, and interference between&#xA;them shows up directly in tail latency.&lt;/p&gt;&#xA;&lt;p&gt;Disaggregation separates them, at the cost of moving KV cache between resources.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why colocating prefill and decode causes interference.&lt;/li&gt;&#xA;&lt;li&gt;How a disaggregated deployment routes a request through both stages.&lt;/li&gt;&#xA;&lt;li&gt;What transferring KV cache between stages costs.&lt;/li&gt;&#xA;&lt;li&gt;When the added complexity is justified.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Prefix caching</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/prefix-caching/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/prefix-caching/</guid>
      <description>&lt;p&gt;Production traffic repeats itself. Shared system prompts, few-shot examples and multi-&#xA;turn conversations all mean requests frequently share a long prefix whose KV cache was&#xA;already computed.&lt;/p&gt;&#xA;&lt;p&gt;Prefix caching reuses that work, which can remove most of the prefill cost for such&#xA;requests.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why real traffic contains so much shared prefix.&lt;/li&gt;&#xA;&lt;li&gt;How cached prefixes are matched and reused.&lt;/li&gt;&#xA;&lt;li&gt;How prefix caching interacts with paged KV cache management.&lt;/li&gt;&#xA;&lt;li&gt;What cache invalidation and eviction require.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Inference routing</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/inference-routing/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/inference-routing/</guid>
      <description>&lt;p&gt;A generic load balancer treats inference replicas as interchangeable and requests as&#xA;equal cost. Neither holds: replicas differ in cached prefixes and queue depth, and&#xA;request cost varies by orders of magnitude.&lt;/p&gt;&#xA;&lt;p&gt;Inference-aware routing uses those signals, and typically improves both latency and&#xA;cache hit rates.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why generic load balancing underperforms for inference traffic.&lt;/li&gt;&#xA;&lt;li&gt;Which signals a router can use to place a request.&lt;/li&gt;&#xA;&lt;li&gt;How prefix-aware routing raises cache hit rates.&lt;/li&gt;&#xA;&lt;li&gt;How routing interacts with autoscaling.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>KV cache offloading</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/kv-cache-offloading/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/kv-cache-offloading/</guid>
      <description>&lt;p&gt;Accelerator memory is the binding constraint on how much KV cache can be retained, and&#xA;therefore on how much prefill work can be reused. Host memory and fast storage are far&#xA;larger and far slower.&lt;/p&gt;&#xA;&lt;p&gt;Offloading trades transfer latency for cache capacity, which is worthwhile when&#xA;recomputation would cost more than the transfer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Which tiers KV cache can be offloaded to.&lt;/li&gt;&#xA;&lt;li&gt;How to decide between recomputing and fetching offloaded cache.&lt;/li&gt;&#xA;&lt;li&gt;How transfer bandwidth bounds the benefit.&lt;/li&gt;&#xA;&lt;li&gt;How offloading composes with prefix caching.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Data, tensor, pipeline, expert and hybrid parallelisms</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/parallelism/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/parallelism/</guid>
      <description>&lt;p&gt;When a model or its workload exceeds one accelerator, the work must be partitioned. The&#xA;available partitioning schemes cut along different axes, impose different communication&#xA;patterns, and are routinely combined.&lt;/p&gt;&#xA;&lt;p&gt;This page explains each scheme and how hybrid strategies are assembled.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What each parallelism scheme partitions, and along which axis.&lt;/li&gt;&#xA;&lt;li&gt;The communication pattern each one requires.&lt;/li&gt;&#xA;&lt;li&gt;Why expert parallelism suits mixture-of-experts models.&lt;/li&gt;&#xA;&lt;li&gt;How hybrid strategies are composed in practice.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Offline batch inference</title>
      <link>https://ait.bsc.es/handbook/inference-optimization/offline-batch-inference/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ait.bsc.es/handbook/inference-optimization/offline-batch-inference/</guid>
      <description>&lt;p&gt;Not all inference is interactive. Bulk classification, dataset annotation and document&#xA;processing have no user waiting, which removes the latency constraint that shapes online&#xA;serving and changes every configuration decision.&lt;/p&gt;&#xA;&lt;p&gt;This page covers how to configure for pure throughput.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-you-will-learn&#34;&gt;What you will learn&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How offline and online serving objectives differ.&lt;/li&gt;&#xA;&lt;li&gt;Which configuration choices change when latency does not matter.&lt;/li&gt;&#xA;&lt;li&gt;How to make a long batch job restartable.&lt;/li&gt;&#xA;&lt;li&gt;How to schedule batch work alongside interactive traffic.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;recommended-outline&#34;&gt;Recommended outline&lt;/h2&gt;&#xA;&lt;p&gt;This page is an outline. The subsections below are the planned structure;&#xA;they are filled in as the handbook is written.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
