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 |
|---|---|
|
TTFT, ITL/TPOT, throughput, interactivity, step latency, comm breakdown |
|
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 |
|---|---|
|
|
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) ⚑ |
|
Sliding-window / local attention |
|
Native sparse attention |
|
Attention kernel library |
|
KV sizing horizon |
|
Parallelism#
Feature |
Flags |
|---|---|
Core shape ⚑ |
|
Attention DP |
|
Multi-node target |
|
Pipeline scheduling |
|
Precision#
Four independent dtype axes, because real deployments mix them:
Flag |
What it governs |
|---|---|
|
resident weight precision — sizes the whole checkpoint |
|
KV-cache precision, so it sets KV footprint and therefore concurrency |
|
the non-expert linears: attention projections and the dense MLP |
|
expert grouped-GEMM compute precision |
|
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 |
|---|---|
|
routing imbalance: hottest-rank / mean token load. |
|
extra replicated expert slots (EPLB) that reduce realized imbalance |
|
Zipf exponent of the router’s popularity law, which sets how many distinct experts a decode step touches — the weight-bandwidth term |
|
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 |
|---|---|
|
draft tokens proposed per verify step ( |
|
expected per-token acceptance in [0,1] |
|
draft forward cost per proposed token, as a fraction of one target decode step. Default |
Speculation is a anchor-defining parameter, so a recipe that turns it on needs its own anchor — see Regimes.
Collectives and communication#
Flag |
Meaning |
|---|---|
|
|
|
force |
|
force |
|
fraction of collective time hidden behind compute, [0,1], default |
|
time multipliers (<1 = a fused or overlapped speedup) |
|
ROCm quick-reduce: low-latency quantized all-reduce for small messages |
|
hides part of the TP all-reduce behind the norm |
|
DeepEP async all-to-all overlapped with compute |
|
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 |
|---|---|
|
scheduler per-step token budget; oversized steps split |
|
per-request per-step prefill allowance, which decides how many steps a prompt takes |
|
capture preset; sets per-step overhead and mixed-batch penalty unless those are given explicitly |
|
extra cost fraction for mixed prefill+decode steps |
|
admission granularity in decode steps — how long a finished prefill waits to join a decode batch |
|
fixed per-step host/launch overhead; CUDA graphs reduce it |
|
the launch-bound decode floor in pure-simulate mode; disabled by graph capture |
|
minimum time a kernel holds the device regardless of data touched — not cancelled by graph capture |
|
fused RMSNorm / RoPE / quant / KV-store kernels that cut per-step launch overhead |
|
GEMM simulation backend, used only in |
Cudagraph mode is anchor-defining. So is the attention backend.
KV cache and memory#
Flag |
Meaning |
|---|---|
|
per-GPU HBM; bounds what fits and the max concurrency |
|
fraction of HBM the engine may claim (vLLM |
|
paged-KV page size in tokens; context rounds up to whole blocks, inflating KV bytes |
|
declared prefix reuse on the analytical path |
|
host DRAM per GPU as a second KV tier (TRT-LLM native / SGLang HiCache |
|
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 |
|---|---|
|
fixed per-request host cost on the TTFT path: accept, parse, admit, prefix lookup, KV allocation, stream open |
|
per-prompt-token server-side tokenization, inside the TTFT clock |
|
per-output-token detokenize + stream, added to ITL/TPOT and e2e but not throughput |
|
output tokens buffered per flush — the client’s first token only arrives after the first flush |
|
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. |
|
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 |
|---|---|
|
the engine does not co-schedule prefill with decode: a prefill batch carries one request and the whole token budget |
|
cap on new sequences entering one prefill step ( |
|
total KV token-slot pool; admission reserves full ISL+OSL per request, so shortage head-of-line blocks |
|
legacy alias for |
|
fraction of requests, in completion order, excluded from the reported distribution (default |
|
RNG seed for arrivals and acceptance sampling (default |
|
write per-step batch-composition records and a packing summary to a JSON path |
|
write every linear-layer GEMM shape the replay ran, with call counts, to a |
|
write every kernel the replay ran, with its shape on one rank and call counts, to a |
|
write the replay’s step mix (its distinct step compositions, counts and cost keys) to a |
|
skip the replay: derive the kernel reports and a re-priced estimate for this run’s deployment from a saved step mix |
|
reuse a step mix even when the schedule it was recorded under differs from this run’s |
|
write one task per kernel to optimize, with the shapes, tensors, a reference and speed of light, to a |
|
apply measured kernel speedups (an |
--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 |
|---|---|---|
|
as |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|---|---|
|
enable separate prefill/decode pools |
|
prefill pool shape |
|
decode pool shape |
|
per-pool attention-DP degree, since deployments commonly run DP attention on one pool only |
|
KV-transfer engine preset (sets link bandwidth and latency) |
|
override that preset |
See Disaggregated serving, including what this path does not model.
Calibration#
Flag |
Meaning |
|---|---|
|
|
|
directory of warmup measurements; the closest same-regime anchor calibrates this projection |
|
use one specific anchor artifact |
|
write the anchor artifact |
|
extra artifacts at other |
|
a sharded artifact whose measured decode step defines the hardware latency floor |
|
how many GPUs the warmup measures on |
|
what to serve while measuring, under which engine, and how many layers to chain per timing stack |
|
override the compute clock from the hardware profile |
Cost#
Flag |
Meaning |
|---|---|
|
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 |
|---|---|
|
the experiment YAML |
|
prompt and generation lengths in tokens |
|
sequences per decode forward — not a cap on serving concurrency, which is |
|
resident sequences, i.e. the operating point |
Accepted aliases#
Alias |
Canonical |
|---|---|
|
|
|
|
|
|
|
|
|
|
--profile-only and --save-profiling exist but have suppressed help; they are
internal profiling plumbing rather than modelling knobs.
Next steps#
Vary any of these automatically instead of by hand: Tuning agent.
What none of them can fix: Boundaries and verification.