INFERENCE ENGINEERING

SCENE 08 / 24 · TRANSFORMATION, COMPILATION & QUANTIZATION

Fuse the graph

Kernel fusion, dead-node elimination and constant folding shrink the launch tax.

KERNEL LAUNCHES · 4
eager mode: 4 launches, 3 HBM round-trips

Eager execution pays the launch tax per op and parks every intermediate tensor in HBM.

ARCHITECTURE & FORMULATIONModule 3: Model Transformation, Compilation & Quantization

Fusion, DCE and constant folding: paying the launch tax once

An eager transformer layer launches dozens of tiny kernels; each launch costs microseconds of CPU dispatch plus an HBM round-trip for intermediates. Graph optimization collapses pointwise chains into single kernels, deletes dead computation, and folds constants — before any hardware-specific tuning happens.

The Launch Tax

A kernel launch is ~5-10 µs of CPU-side overhead. A 32-layer model with 40 eager ops per layer burns milliseconds per step on dispatch alone at batch 1.

Fusion's Real Win

Bandwidth, not launches: a LayerNorm+GELU+add chain written eagerly writes each intermediate to HBM (7 GB/s of traffic per token at 7B). Fused, intermediates live in registers.

Compiler Passes

Dead-node elimination prunes unused branches; constant folding precomputes what weights alone determine; layout propagation picks NHWC/NCHW per target.

MATHEMATICAL FORMULATION · TRAFFIC SAVED BY FUSION
bytes_saved ≈ (nodes_fused − 1) × tensor_bytes × (reads + writes)

Fusing a 3-op chain over a 4k-token activation saves ~2 × 3 × activation-size of HBM traffic per layer, per step — often a 20-40% end-to-end decode speedup at batch 1.

REAL-WORLD PRODUCTION ENGINEERING
  • torch.compile's mode='max-autotune' and TensorRT both run these passes; the difference is schedule quality, not pass coverage.
  • CUDA graphs capture the whole launch sequence once and replay it, eliminating dispatch jitter for decode loops.
Agent-native web · research mode

Experimental WebMCP · evolving community-group draft, not a W3C Standard or on the Standards Track.

Native status: Initializing. Registered: none

DOM → inferred capabilities · WebMCP → declared capabilities. Tools read real CUDA/Inference Atlas content. Calls may highlight temporary UI state. No backend or remote telemetry.

Local harness verifies application logic; it does not demonstrate native discovery or a browser agent.

Input schema
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}

Local log: last 100 calls while this panel is open. Inputs may contain personal text; review before sharing.

[]