Modeled features#

One-pager

What: the map of what InferaSim actually models, grouped by concern, with the flag that controls each. Why: the task pages show the common paths; this page is so nothing is invisible. Cost: none — almost everything here defaults to the engine’s or the model’s own behaviour.

inferasim inference --help is the authoritative list (133 flags). This page groups them by what question they answer, so you can find the lever without reading all of it. For what is deliberately not modeled, see Boundaries and verification.

Most of these only need setting when you are modelling a deployment that differs from the default. The ones that change an answer most often are marked ⚑.

Two projections#

--inference-mode {performance,memory,both} selects which runs; the default is both.

Projection

Reports

performance

TTFT, ITL/TPOT, throughput, interactivity, step latency, comm breakdown

memory

weights, KV cache, activation working set, total per-GPU HBM, and whether the recipe fits

Memory is analytical at every parallelism and is never calibrated by a measurement — see Memory is outside the calibration loop.

Serving model#

Flag

Meaning

--serving-model {continuous,static} ⚑

continuous (default) models continuous batching with mixed prefill+decode steps, and therefore TPOT pollution. static is an idealized pure-decode batch with prefill charged once as TTFT.

If you are comparing against a number from a real server, you want continuous. static is for isolating decode from interference.

Model architecture and attention#

Feature

Flags

Data-parallel attention (MLA) ⚑

--attention-dp-size — see the explanation

Sliding-window / local attention

--sliding-window (KV tokens attended; 0 forces full attention), --sliding-window-layer-fraction (for models interleaving local and global layers)

Native sparse attention

--sparse-attention-topk — DeepSeek V3.2/V4-style NSA; attention scales toward topk/context at long context. 0 is dense.

Attention kernel library

--attention-backend {aiter,triton,ck,hip} — a compute multiplier relative to the Triton baseline

KV sizing horizon

--max-context-len — largest prompt+generated context for KV sizing, defaulting to input+output

Parallelism#

Feature

Flags

Core shape ⚑

INFERASIM_TP / _EP / _PP / _CP / _VP, or --target-ep-size to override EP for the target

Attention DP

--attention-dp-size

Multi-node target

--target-nodes / --target-num-nodes, --hardware-config

Pipeline scheduling

--pipeline-schedule-algorithm (auto, zerobubble, zbv-*, seaailab-ilp, …), --enable-zero-bubble, --num-virtual-stages-per-pipeline-rank, --micro-batch-size, --global-batch-size

Precision#

Four independent dtype axes, because real deployments mix them:

Flag

What it governs

--weight-dtype ⚑

resident weight precision — sizes the whole checkpoint

--kv-cache-dtype ⚑

KV-cache precision, so it sets KV footprint and therefore concurrency

--linear-weight-dtype

the non-expert linears: attention projections and the dense MLP

--moe-expert-dtype

expert grouped-GEMM compute precision

--act-quant-dtype

precision activations are cast to before each low-precision GEMM (a memory-bound cast cost)

Sizing a 4-bit checkpoint at 4 bits while streaming it at 8 is the classic error here, which is why the linear and expert precisions are separable from --weight-dtype.

Mixture of experts#

Flag

Meaning

--ep-load-balance ⚑

routing imbalance: hottest-rank / mean token load. 1.0 is perfectly balanced; above that inflates expert compute at EP>1.

--redundant-experts

extra replicated expert slots (EPLB) that reduce realized imbalance

--moe-routing-skew

Zipf exponent of the router’s popularity law, which sets how many distinct experts a decode step touches — the weight-bandwidth term

--moe-router-coverage

measured router coverage as JSON: how many distinct experts the real router reaches per step, versus what independent per-token routing predicts

Speculative decoding#

Flag

Meaning

--speculative-num-tokens ⚑

draft tokens proposed per verify step (0 disables)

--speculative-acceptance-rate ⚑

expected per-token acceptance in [0,1]

--speculative-draft-cost-factor

draft forward cost per proposed token, as a fraction of one target decode step. Default 0, i.e. draft cost ignored.

Speculation is a anchor-defining parameter, so a recipe that turns it on needs its own anchor — see Regimes.

Collectives and communication#

Flag

Meaning

--comm-model {explicit,builtin}

explicit (default) gives the knob-driven breakdown; builtin folds comm into layer time with no breakdown

--tp-allreduce-algo

force ring, one_shot, two_shot, hierarchical (default auto = fastest)

--ep-a2a-algo

force direct, single_shot, hierarchical (default auto)

--prefill-comm-overlap / --decode-comm-overlap ⚑

fraction of collective time hidden behind compute, [0,1], default 0

--tp-allreduce-efficiency / --ep-a2a-efficiency

time multipliers (<1 = a fused or overlapped speedup)

--quick-reduce

ROCm quick-reduce: low-latency quantized all-reduce for small messages

--fuse-rmsnorm-allreduce

hides part of the TP all-reduce behind the norm

--enable-deepep

DeepEP async all-to-all overlapped with compute

--sync-free-stage

SyncFree MoE stage 1–3 (fused router, +DeepEP+grouped, +fused act); auto-enables DeepEP

The report’s exposed-communication breakdown is what tells you whether any of this is worth reaching for.

Scheduler, graphs and step overheads#

Flag

Meaning

--max-num-batched-tokens ⚑

scheduler per-step token budget; oversized steps split

--chunked-prefill-size ⚑

per-request per-step prefill allowance, which decides how many steps a prompt takes

--cudagraph-mode {none,piecewise,full} ⚑

capture preset; sets per-step overhead and mixed-batch penalty unless those are given explicitly

--mixed-batch-penalty

extra cost fraction for mixed prefill+decode steps

--decode-admission-steps

admission granularity in decode steps — how long a finished prefill waits to join a decode batch

--decode-step-overhead-us

fixed per-step host/launch overhead; CUDA graphs reduce it

--kernel-launch-latency-us, --kernels-per-layer

the launch-bound decode floor in pure-simulate mode; disabled by graph capture

--decode-kernel-occupancy-us

minimum time a kernel holds the device regardless of data touched — not cancelled by graph capture

--fused-kernels

fused RMSNorm / RoPE / quant / KV-store kernels that cut per-step launch overhead

--gemm-backend origami

GEMM simulation backend, used only in simulate and both

Cudagraph mode is anchor-defining. So is the attention backend.

KV cache and memory#

Flag

Meaning

--hbm-capacity-gb ⚑

per-GPU HBM; bounds what fits and the max concurrency

--kv-cache-memory-fraction ⚑

fraction of HBM the engine may claim (vLLM gpu_memory_utilization / SGLang mem_fraction_static)

--kv-block-size

paged-KV page size in tokens; context rounds up to whole blocks, inflating KV bytes

--prefix-cache-hit-rate

declared prefix reuse on the analytical path

--kv-offload-gb-per-gpu

host DRAM per GPU as a second KV tier (TRT-LLM native / SGLang HiCache dram)

--kv-offload-bw-gbps

host↔device bandwidth for that tier (PCIe 5 x16 ≈ 64; a coherent host link ≈ 900)

The offload tier is priced analytically as a bounded allowance plus its transfer bandwidth. The DES has one device-resident tier — see Boundaries.

Host-side costs on the latency path#

These exist because a client-measured TTFT is not the forward pass. Quoting a measured number against a projection that omits them is how a model reads systematically early.

Flag

Meaning

--request-overhead-ms

fixed per-request host cost on the TTFT path: accept, parse, admit, prefix lookup, KV allocation, stream open

--tokenize-overhead-us

per-prompt-token server-side tokenization, inside the TTFT clock

--detokenize-overhead-us

per-output-token detokenize + stream, added to ITL/TPOT and e2e but not throughput

--stream-interval

output tokens buffered per flush — the client’s first token only arrives after the first flush

--prefill-rate-us-per-token, --prefill-rate-lo-tokens, --prefill-rate-hi-tokens

a measured prefill rate and the two prompt lengths it was fit over. A rate without its span is meaningless, so the span is required alongside it.

--sampling-top-k, --sampling-top-p, --sampling-temperature, --no-sampling

logits post-processing cost; top-k adds a partial sort, top-p a threshold+renormalize, temperature a fused scale

Discrete-event simulator#

Beyond the common flags on Simulation runs and Fleet and routing:

Flag

Meaning

--des-exclusive-prefill

the engine does not co-schedule prefill with decode: a prefill batch carries one request and the whole token budget

--des-max-prefill-seqs

cap on new sequences entering one prefill step (0 = only the token budget limits admission)

--des-kv-cache-tokens

total KV token-slot pool; admission reserves full ISL+OSL per request, so shortage head-of-line blocks

--des-cache-slots

legacy alias for --des-kv-blocks

--des-warmup-frac

fraction of requests, in completion order, excluded from the reported distribution (default 0.1) — a reporting convention, not engine behaviour

--des-seed

RNG seed for arrivals and acceptance sampling (default 0, so runs are reproducible)

--des-dump-steps

write per-step batch-composition records and a packing summary to a JSON path

--des-gemm-shapes

write every linear-layer GEMM shape the replay ran, with call counts, to a .csv or .json path

--des-kernel-shapes

write every kernel the replay ran, with its shape on one rank and call counts, to a .csv or .json path

--des-step-mix

write the replay’s step mix (its distinct step compositions, counts and cost keys) to a .json path, to reuse under other deployments

--from-step-mix

skip the replay: derive the kernel reports and a re-priced estimate for this run’s deployment from a saved step mix

--step-mix-force

reuse a step mix even when the schedule it was recorded under differs from this run’s

--kernel-tasks

write one task per kernel to optimize, with the shapes, tensors, a reference and speed of light, to a .json path (and a .md beside it)

--kernel-speedups

apply measured kernel speedups (an inferasim.kernel_speedups JSON) to the kernel report and to every step’s cost

--des-dump-steps is the one to use when you disbelieve a latency number: it shows what was in every step.

Kernel shapes for tuning#

--des-gemm-shapes and --des-kernel-shapes turn a replay into the set of kernel shapes a serving stack should tune or pre-select for. The shapes come from the steps the replay executed, so they are the mix a trace produces under continuous batching rather than a fixed sweep. Both follow the engine’s sharding on one rank. Each layer is counted where the model puts it: a hybrid model’s full, windowed, linear and DeepSeek-V4 compressed layers each give their own rows, and under pipeline parallelism each row carries the stage that runs it.

--des-kernel-shapes is a superset of the GEMM report. Each row has a kind:

Kind

Ops

Shape columns

gemm

as --des-gemm-shapes

m, n, k, groups, topk, rows_per_expert

attention

attn_prefill, attn_decode

batch (sequences), q (query tokens; per sequence for decode), max_q, max_kv and mean_kv (span attended, this step included), heads, kv_heads, qk_dim, v_dim, window, topk; DeepSeek-V4 adds compress, pool_kv, mean_pool_kv

indexer

indexer_prefill, indexer_decode, indexer_topk, index_cache_write

batch, q, max_kv and mean_kv (candidates scored), heads, dim; rows, candidates, k

linear_attention

gdn_prefill / kda_prefill, gdn_decode / kda_decode, causal_conv1d

batch, q, key_heads, value_heads, dk, dv; tokens, channels, kernel

moe

moe_topk, moe_align, moe_silu_and_mul, moe_sum

tokens, experts, topk, local_experts, rows, width

norm

rmsnorm, qk_rmsnorm, MLA’s q_a_rmsnorm / kv_a_rmsnorm, V4’s kv_rmsnorm, gated_rmsnorm, moe_latent_rmsnorm

tokens, width, heads

elementwise

embedding, rope, kv_cache_write, pool_cache_write, silu_and_mul, shared_silu_and_mul, attn_gate_mul, mHC’s hc_sinkhorn / hc_apply, attn_res_mix

tokens, width, heads, kv_heads, dim, vocab, streams, iters, blocks

quant

<gemm op>_act_quant, one per low-precision GEMM input when activations are quantized

rows, width

collective

tp_allreduce (or tp_allgather + tp_reduce_scatter under attention-DP), ep_dispatch, ep_combine, dcp_allgather, dcp_reduce_scatter, pp_send_recv, embed_allreduce, logits_allgather

ranks, bytes

sampling

sampling

rows, vocab

The GEMMs cover each family’s own projections: MLA’s output gate (attn_gate; a GQA gate widens attn_qkv), DeepSeek-V4’s attn_q_a, attn_q_b, attn_kv, grouped attn_o_a and attn_o_b, its compressors, indexer projections and mHC mixers (hc_mixer, hc_head), a uniform sparse indexer’s idx_q, idx_k and idx_weights, a gated delta net’s gdn_in_proj_qkvz, gdn_in_proj_ba and gdn_out_proj, KDA’s kda_q, kda_k, kda_v, decay, beta, gate and output projections, and a latent MoE’s moe_latent_down and moe_latent_up.

Attention is where a token count is not enough. Each row is one step composition on one rank, so you can see both how many sequences a step carries and how far back they attend. KV spans are bucketed up to 256 tokens and prefill query lengths to 64, so a long trace gives a tunable set of rows. MLA prefill is the per-head attention it runs. MLA decode is the absorbed form, one KV head of width kv_lora_rank + rope over the latent, so the kernel report lists decode’s two per-head batched GEMMs, attn_q_absorb and attn_o_absorb, and keeps attn_kv_b for the prefill’s keys and values only (the GEMM report lists MLA unabsorbed). Under attention-DP a rank attends over its share of the sequences with tp / dp of the heads. Under decode context parallelism it attends over 1 / dcp of each span, for the heads its group gathered. Windowed layers are reported as their own rows, with window set. Their decode span is capped at the window only when the engine keeps just the window’s blocks (sink_window_decode_capped). A DeepSeek-V4 layer attends over its 128-token window plus its compressed pool: pool_kv is the span over compress (4 for CSA, 128 for HCA), capped at the indexer’s top-k on CSA layers. A top-k sparse model’s rows carry topk, and its indexer scores the full span.

A decode-only step that fits a captured CUDA graph runs at the graph’s size, so its GEMMs, norms and MoE kernels see the padded batch while attention keeps the real sequences and the LM head the rows it samples. The capture sizes are cudagraph_capture_sizes when the request config gives them, else the engine’s default ladder (vLLM: 1, 2, 4, then every 8 to 256 and every 16 to 512; SGLang adds 12 and steps by 8 from 16). cudagraph_mode: none turns padding off; mixed steps are never padded.

Collectives follow the communication model the projection prices, and give the message in bytes. That is what decides between custom all-reduce, quick-reduce and RCCL.

With speculative decoding, the drafter’s own forward is a separate pool, <pool>/draft, on the target’s last stage. An autoregressive drafter (MTP, EAGLE) gives one extend pass over the accepted tokens and then one single-token pass per further draft. A parallel drafter (DFlash) gives one pass over all its positions. MTP adds draft_eh_proj, EAGLE3 and DFlash add draft_fc, and a serial head adds draft_serial_head.

Every row carries est_us, the time of one call, and est_source, which says where the time came from. GEMMs use Origami when it is installed. Attention uses the projection’s SDPA simulator. Collectives use the communication model. All other kernels use a roofline over their bytes and FLOPs at the projection’s achievable bandwidth and compute. The .json output adds by_op, which gives the calls, the number of distinct shapes and est_total_ms per op.

Reusing one replay for other deployments#

The kernels a step launches follow from what the step carries and the deployment alone. --des-step-mix saves a replay’s distinct steps with their counts, and --from-step-mix re-derives every kernel report from them for another TP, EP, PP, attention-DP or DCP split, other weight, KV or activation dtypes, another engine or GPU, without replaying. It also re-prices each step under the new deployment’s cost model and rescales the replay’s makespan, throughput and latencies by the change in busy time.

Reuse is exact when the schedule could not have changed: the same workload, lengths, scheduler limits and speculation, a closed loop with no think time, and a KV pool that still holds what the replay kept resident. A change to the schedule refuses reuse unless --step-mix-force is given. An open-loop replay, think time or a smaller KV pool are allowed but reported as approximate, because a much faster or slower deployment would have batched differently. With a shorter decode window the reused spans are re-capped at the new window.

Kernel tasks for an optimizing agent#

--kernel-tasks groups the kernel report into one task per pool, op and dtype, ranked by estimated GPU time. Each task says what the kernel computes, its tensors with shapes in the case’s dimension names, dtypes and layouts, a torch reference, the output tolerance, the engine kernels it usually dispatches to and the keys tuners select by. Its cases are the distinct shapes that cover 95% of its time (at most 24), each with calls, its share, the estimate and its source, the speed of light at the GPU’s peak bandwidth and compute, and whether it is memory or compute bound. share_pct is of the kernel time on the task’s GPUs (a drafter’s tasks share the target’s), and e2e_gain_pct_at_speed_of_light is what reaching speed of light would save of it. A task whose estimate is itself a roofline says so in estimate_basis: its headroom is that assumption, not a finding. A task estimated under speed of light carries a warning.

Feeding measured speedups back#

--kernel-speedups takes what a tuner or kernel agent measured:

{"schema": "inferasim.kernel_speedups", "version": 1,
 "entries": [
  {"op": "moe_gate_up", "speedup": 1.3},
  {"op": "attn_qkv", "dims": {"n": 1280, "k": 2880}, "ranges": {"m": [1, 512]},
   "baseline_us": 21.4, "tuned_us": 15.0, "source": "gemm-tune"},
  {"op": "*", "pool": "decode", "speedup": 1.05}
 ]}

An entry matches a kernel when every field it names matches (op * matches any op), and the most specific match wins. The kernel report keeps est_us_base and gains speedup. Each step’s cost is scaled by how much its own kernels got faster, the sum of their new times over their old ones. That is an Amdahl estimate, since kernels overlap within a step. With --from-step-mix this projects what the speedups buy end to end without a replay.

Disaggregation#

Each pool takes its own full shape, not just its own TP:

Flag

Meaning

--disaggregate

enable separate prefill/decode pools

--prefill-tp / --prefill-ep / --prefill-pp / --prefill-replicas

prefill pool shape

--decode-tp / --decode-ep / --decode-pp / --decode-replicas

decode pool shape

--prefill-attention-dp / --decode-attention-dp

per-pool attention-DP degree, since deployments commonly run DP attention on one pool only

--transfer-backend {nixl,mooncake,mori}

KV-transfer engine preset (sets link bandwidth and latency)

--kv-transfer-bw-gbps / --kv-transfer-latency-us

override that preset

See Disaggregated serving, including what this path does not model.

Calibration#

Flag

Meaning

--profiling-mode ⚑

benchmark (default), simulate, both

--anchor-store ⚑

directory of warmup measurements; the closest same-regime anchor calibrates this projection

--load-benchmark

use one specific anchor artifact

--save-benchmark

write the anchor artifact

--load-benchmark-scaling

extra artifacts at other --benchmark-gpus values, to fit how the step scales with TP instead of assuming TP⁻¹

--decode-floor-benchmark

a sharded artifact whose measured decode step defines the hardware latency floor

--benchmark-gpus

how many GPUs the warmup measures on

--bench-model, --bench-serving-backend, --inference-bench-layers

what to serve while measuring, under which engine, and how many layers to chain per timing stack

--gpu-clock-mhz

override the compute clock from the hardware profile

See Anchors and calibration.

Cost#

Flag

Meaning

--gpu-cost-per-hour

prices projected throughput as cost per million tokens, charging the whole replica

Workload shape#

Set on every run, and used in the examples throughout these pages:

Flag

Meaning

--config (alias --exp)

the experiment YAML

--input-len / --output-len ⚑

prompt and generation lengths in tokens

--inference-batch-size

sequences per decode forward — not a cap on serving concurrency, which is --max-concurrency

--max-concurrency ⚑

resident sequences, i.e. the operating point

Accepted aliases#

Alias

Canonical

--exp

--config

--prefix-hit-fraction

--prefix-cache-hit-rate

--des-new-seqs-per-step

--des-max-prefill-seqs

--des-cache-slots

--des-kv-blocks

--target-num-nodes

--target-nodes

--profile-only and --save-profiling exist but have suppressed help; they are internal profiling plumbing rather than modelling knobs.

Next steps#