Sampling Distributions in YAML Configs
Several fields in an AIPerf YAML config — input/output token lengths, conversation turn counts, turn delays, image dimensions, audio length, and ranking passage counts — accept a sampling distribution instead of a single number. This tutorial covers all five distribution shapes AIPerf supports, the auto-detection rules that pick between them, and the optional min:/max: clamps that compose with any of them.
If you only ever write isl: 512, you’ve already used a distribution — that scalar is the shorthand for a FixedDistribution. Everything below extends from there.
Where distributions show up
Any field in a YAML config typed as a sampling distribution accepts the full set of shapes described in this tutorial. The current list:
Wherever you see {mean: ..., stddev: ...} in a template, you can swap in any other shape from this page.
The five distribution types
AIPerf supports five distribution shapes, and figures out which one you mean from the keys you wrote — you don’t have to add a type: key. The discriminator is purely structural:
You can override the inference with an explicit type: if you’d rather be loud:
type: accepts one of fixed, normal, lognormal, multimodal, empirical. AIPerf strips it after dispatch, so the rest of the dict is parsed normally.
Fixed — a constant
The simplest case. Every sample returns the same value.
Use a fixed distribution when you want a deterministic input or output size — e.g. reproducing a sizing study or feeding a controlled stress test.
Normal — Gaussian around a mean
A truncated Gaussian implemented via rejection sampling (samples below 0 are redrawn; falls back to clamped-mean if 10k iterations fail to land in range). Parameterised by mean and stddev.
This is the workhorse for “vary around a target.” If stddev: 0 is set or omitted, the distribution collapses to deterministic — equivalent to fixed.
A few details worth knowing:
meanmust be>= 0. Zero is allowed (e.g.osl: {mean: 0}disables output,turn_delay: {mean: 0}disables inter-turn delay).stddevmust be>= 0. Default is0.- A bare
{mean: 512}(nostddev, nomedian) is still treated as Normal — a Normal with zero stddev. This is intentional: it keeps the rule “setmeanand you get a Normal” simple. If you want a log-normal with no skew, write{mean: 512, median: 512}.
Log-normal — right-skewed, always positive
A log-normal distribution parameterised by mean and median. Skew is controlled by the mean / median ratio: the larger the ratio, the heavier the right tail. When mean == median it collapses to deterministic.
Constraints:
- Both
meanandmedianmust be> 0. medianmust be<= mean. (A log-normal with median > mean is mathematically impossible.)
Use log-normal when modelling sizes that are bounded below by zero and have a long right tail — chat prompt lengths, retrieval-augmented context windows, “most requests are small but some are huge” workloads.
Multimodal — a mixture of N peaks
A weighted mixture of two or more sub-distributions. Each peak is itself a distribution, written inline, with an optional weight.
Notes:
- Requires at least 2 peaks.
- Each peak follows the same auto-detection rules — write
{stddev: ...}for Normal peaks,{median: ...}for log-normal peaks,{value: N}for fixed peaks. - Weights are relative — they’re normalised internally, so
[60, 30, 10]and[6, 3, 1]produce the same mixture. weightis optional and defaults to1.0. Omit it on every peak to get an equal split.
Use multimodal when your real workload is a mix of distinct request shapes — e.g. a chat product where 70% of traffic is one-shot Q&A and 30% is long document summarisation. A single Normal can’t capture that.
Empirical — discrete weighted values
A discrete distribution sampled from a set of weighted values. No interpolation, no Gaussian — each draw returns one of the values you listed.
Notes:
- Requires at least one point. Weights must be
> 0and are normalised internally. weightdefaults to1.0— omit it for an equal-probability sampler over the listed values.
Use empirical when you have measured frequencies from production traces and want to reproduce them exactly without smoothing into a parametric shape.
Clamping with min: / max:
Every distribution shape — including the scalar shorthand — accepts optional min: and max: bounds. Samples outside the range are clamped (not resampled), so the bounds are hard limits, not statistical guarantees.
A few rules:
- Bounds are inclusive:
min: 32means values down to and including 32 are kept; below 32 is clamped up to 32. min:andmax:must be finite. NaN/inf are rejected at config-validation time so they can’t silently disable clamping.- If both are set,
min <= maxis enforced. - Bounds compose with every shape — Fixed, Normal, Log-normal, Multimodal, and Empirical.
For multimodal distributions, a top-level min/max applies to the output of the mixture. If you want different bounds per peak, set min/max on each peak’s sub-distribution instead.
Disambiguation cheat-sheet
If AIPerf can’t figure out what shape you meant, it errors at config-load time with a message that names the keys it saw. The most common causes:
When in doubt, run:
The validator runs the same load pipeline aiperf profile does, so any distribution-shape problem surfaces here before you spend compute.
Combining with sweeps
Sweep parameters (sweep.parameters) can replace a distribution wholesale. The right-hand side of a sweep entry is the value that gets substituted into the body, so you can sweep across distribution shapes the same way you sweep across scalars:
That gives you three benchmark variations, each with a different ISL shape, while the rest of the body stays constant. Pair with multi_run for confidence intervals per shape — see Multi-Run Confidence Reporting.
Worked example — a realistic chat workload
Putting it all together: a synthetic dataset that mixes short and long queries, with a log-normal output shape and clamped bounds.
Run it with:
Where to go next
- YAML Configuration Files — the broader walkthrough of YAML configs, sweeps, and multi-run.
- Sequence Length Distributions — the legacy
--sequence-distributionstring format used on the CLI for paired ISL/OSL mixtures (separate feature). - Multi-Run Confidence Reporting — repeating a benchmark for confidence intervals on top of any of these shapes.
- Parameter Sweeps — how to sweep across distribution shapes themselves.