# Methodology Every fairness decision in this repo, written down, with the reasoning. Read this before quoting any number. ## The question being asked On paper the MI300X wins essentially every headline specification against the H200: | | MI300X | H200 | AMD advantage | |---|---|---|---| | BF16 dense | 1307.4 TFLOP/s | 989.4 TFLOP/s | **1.32×** | | FP8 dense | 2614.9 TFLOP/s | 1978.9 TFLOP/s | **1.32×** | | HBM bandwidth | 5.3 TB/s | 4.8 TB/s | **1.10×** | | Memory capacity | 192 GB | 141 GB | **1.36×** | | TBP | 750 W | 700 W | — | Published head-to-heads nonetheless tend to show the H200 ahead on real serving. So the question this repo answers is **not** "which is faster" — it is **"how much of AMD's paper advantage survives contact with the software stack, and where exactly does it leak?"** That framing drives the whole design. Every application-level result is anchored to a microbenchmark, so a loss can be *attributed* — to silicon, to kernels, or to framework defaults — rather than merely asserted. ## Single GPU, deliberately One MI300X against one H200. This removes the largest confound in most published AMD-vs-NVIDIA comparisons: interconnect. No NVLink, no Infinity Fabric, no RCCL-vs-NCCL collective performance, no topology effects. What remains is the accelerator and its software. ## The eight rules ### 1. One upstream project, one version Both machines run **vLLM v0.26.0** from the vLLM project's own images: - `vllm/vllm-openai-rocm:v0.26.0` - `vllm/vllm-openai:v0.26.0-x86_64-cu129-ubuntu2404` Both ship **PyTorch 2.11.0**, differing only in ROCm 7.2 versus CUDA 12.9. This matters more than it looks. AMD's own `rocm/vllm` images are deprecated in favour of the upstream ones, and using a vendor-maintained fork on one side and upstream on the other would compare two different codebases and call the difference hardware. Image digests are recorded in each box's `specs.txt`. ### 2. FP8 is derived on-device, from one shared BF16 checkpoint This is the subtlest fairness decision here. gfx942 implements FP8 as **`e4m3fnuz`**; Hopper implements **`e4m3fn`**. They are different encodings. Essentially every pre-quantized FP8 checkpoint on HuggingFace was produced on NVIDIA hardware in `e4m3fn`, so shipping one to both machines gives NVIDIA its native format and forces AMD onto a conversion path — a measurable handicap that has nothing to do with the silicon. So the FP8 lane loads the **identical BF16 checkpoint** on both sides and lets each derive its own native FP8 in-process (`--quantization fp8`). Each GPU uses the format its hardware actually implements. The consequence is that the two machines are **deliberately not bit-identical in the FP8 lane**. That is intentional, and Lane 6 measures what it costs rather than hiding it. ### 3. Identical weights, verified `shared/verify_models.sh` SHA-256s every `.safetensors`, `config.json` and tokenizer file on both boxes. The hashes are committed. "Both GPUs ran the same weights" is a checkable claim here, not an assumption. The Llama repos also ship an `original/*.pth` duplicate of the same weights that vLLM never loads. It is excluded at download time and deliberately not hashed; its presence on one box and absence on the other is irrelevant to what executes. ### 4. The MI300X stays in SPX / NPS1 Verified and recorded, never changed. The MI300X can be partitioned into up to eight logical GPUs (CPX); doing so would invalidate the one-GPU-each pairing entirely. `specs.txt` records `Compute Partition: SPX`, `Memory Partition: NPS1` — one logical GPU, all 304 CUs, all 192 GB. ### 5. Saturation is measured, never assumed `shared/telemetry.py` samples utilization, HBM used, power, temperature and clocks at 1 Hz on the host for **every** benchmark. `summarize.py` refuses to emit a result row that has no matching telemetry CSV, and counts what it dropped. This is what backs two otherwise-unfalsifiable claims: that the GPU was actually saturated, and the tokens-per-joule figures. It also catches host-bottlenecked runs — if the 16-thread H200 host cannot feed vLLM at concurrency 256, that appears as a utilization dip rather than as a fake GPU deficiency. ### 6. Both stock and vendor-tuned, reported separately - **Run A (stock).** Identical vLLM arguments, **zero** vendor environment variables on either side. What you get on day one. - **Run B (tuned).** Each vendor's own officially-published tuning, and nothing else. AMD's comes from the ROCm "vLLM V1 performance optimization" and MI300X workload tuning guides (`mi300x/env/tuned.env`); NVIDIA's from the vLLM CUDA docs (`h200/env/tuned.env`). Neither file contains anything invented or hand-tuned by us. The `h200/env/tuned.env` file is conspicuously shorter than the AMD one, and that asymmetry is itself a reportable result: it quantifies how much hand-holding each stack needs before the hardware performs as documented. `NCCL_MIN_NCHANNELS` is deliberately omitted from the AMD file — it is a multi-GPU RCCL knob and this is a single-GPU comparison. #### What the tuned *microbenchmark* lane can and cannot test Lane 1b re-runs the GEMM and attention microbenchmarks under `tuned.env`. It is cheap and decisive, but it tests a strict subset of the tuning, and the distinction matters for what may be concluded: - **Tested.** `TORCH_BLAS_PREFER_HIPBLASLT` and `HIP_FORCE_DEV_KERNARG` act on the PyTorch/HIP layer, so they affect `torch.matmul` directly. - **NOT tested.** `VLLM_ROCM_USE_AITER` and `VLLM_USE_TRITON_FLASH_ATTN` are **vLLM-level** flags. They select fused kernels inside vLLM and have no effect on a raw `torch.matmul` call. Their contribution can only appear in the tuned *serving* sweeps. So a null result in lane 1b supports the narrow claim that *AMD's documented library-selection flags do not change raw GEMM throughput* — the gap is in the kernels themselves rather than in which library gets chosen. It does **not** establish that AITER's fused serving kernels are ineffective. Only Run B of lane 2 can speak to that. The H200 serves as the negative control for this lane: NVIDIA's `tuned.env` sets only a sampler flag, so its tuned-vs-stock GEMM ratio establishes the measurement noise floor against which any AMD delta is judged. ### 7. The CPU lane is a host comparison, not a chip comparison The two hosts are not comparable and were not chosen by the GPU vendors: | | MI300X box | H200 box | |---|---|---| | CPU | Xeon Platinum 8568Y+ | Xeon Platinum 8468 | | Cores / threads | 20 / 20 | 8 / 16 | | RAM | 235 GB | 196 GB | The MI300X host has **2.5× the physical cores**. Any CPU number is a statement about the rented instance. It is measured anyway because it answers a question that does matter for the GPU result: *can the host feed the GPU?* ### 8. No sparsity, no per-dollar, no per-watt headlines - Peak figures used for "% of peak" are **dense**. No benchmark here uses structured sparsity, so comparing against a sparsity-doubled peak would understate both parts. - TBP differs (750 W vs 700 W) and cloud pricing is provider-specific and negotiable. Power and energy are published as raw measurements; they are not turned into efficiency or TCO headlines. ## What is measured | Lane | What | Why it is in here | |---|---|---| | 0 | Provenance + 1 Hz telemetry | Makes every later claim checkable | | 1 | GEMM, HBM bandwidth, attention | Roofline anchors for attribution | | 2 | vLLM serving, 3 models × 3 shapes × 8 concurrencies | The headline | | 2b | 70B BF16 capacity lane | A capability gap, not a win | | 3 | Training: throughput, TFLOP/s, MFU, loss trace | Different bottleneck to inference | | 4 | Host CPU | Bottleneck detection | | 5 | 30-minute sustained load | Validates every short run above it | | 6 | Greedy + logprob cross-check | Guards against "fast but wrong" | ### Microbenchmark specifics Three methodological details that are commonly got wrong, and are the difference between a roofline and a marketing number: - **Median, not min or max.** Reporting the fastest of N iterations measures best-case cache state, not throughput. - **Last-level cache flushed between every timed iteration.** 512 MB, sized to clear both the MI300X's 256 MB Infinity Cache and the H200's 50 MB L2. *Not* flushing systematically flatters AMD, because it has 5× the cache to hide behind. - **Device events for timing**, with a synchronize before each measurement window — not wall clock. GEMM shapes include both square matrices and the real projection shapes from Llama 3.1 8B and 3.3 70B, including decode-shaped skinny GEMMs. Square GEMMs flatter whichever chip has more raw FLOPs; real LLM shapes expose scheduling and launch overhead. ### Serving specifics ISL/OSL ∈ {1k/1k, 1k/8k, 8k/1k} — the InferenceX standard set, chosen because they exercise genuinely different regimes: balanced, decode-heavy (bandwidth-bound, should favour HBM), and prefill-heavy (compute-bound, should favour raw FLOPs). A chip can plausibly win one and lose another, which is precisely why a single "tokens/sec" headline is misleading. Concurrency produces a **Pareto curve of throughput (tok/s/GPU) against interactivity (tok/s/user)** rather than a single point. Fixed seed, `--ignore-eos` so output length is exact and not model-dependent. **The grid is not uniform across models, and that is declared, not hidden.** Measured on the 8B model, a 1k/1k point costs ~1 minute but a 1k/8k point costs 4–6 minutes, because every request emits 8192 tokens. Scaling that to the 70B model put a single full sweep at ~7 hours per box and the whole suite past 20 hours, so the large models use fewer concurrency points: | Lane | Concurrency points | |---|---| | 8B, stock | 1, 4, 8, 16, 32, 64, 128, 256 (full) | | 70B-FP8 / gpt-oss-120b, stock | 1, 8, 32, 128, 256 | | Run B (vendor-tuned), 8B + 70B-FP8 | 1, 32, 256 | Three rules constrain the reduction: 1. **The shape set is never reduced.** Dropping 1k/8k or 8k/1k would remove an entire regime — decode-heavy or prefill-heavy — and could genuinely change which GPU wins. Only concurrency resolution is traded away, and the endpoints and the knee of every curve are retained. 2. **Every sweep writes `grid.json`** next to its results, recording the grid actually used and flagging `reduced: true`. A reduced sweep cannot be mistaken for a full one by anyone reading the raw output. 3. **Run B is a delta measurement, not a second Pareto map.** Its purpose is to quantify how much each vendor's published tuning buys, which three concurrency points capture. gpt-oss-120b is excluded from Run B because AMD's published tuning targets the dense transformer path. #### Server warm-up is a ~15% effect, and it is a confound Two independent lanes converged on the same number here, which is why it is called out rather than buried. 1. **Sweep composition.** Repeating identical stock points (lane 1c) reproduced an earlier accidental repeat *exactly* — same points, same magnitudes. That is systematic, not random. The cause is the path taken to a given concurrency: the full sweep walks 1, 4, 8, 16, 32, … so the server is well warmed by the time it reaches 32, while a coarse grid jumps 1 → 32. Compared across grids the discrepancy reaches **14%**; compared like-for-like, repeatability is **±0.5%**. 2. **Sustained load.** The 30-minute soak repeats one identical workload. Its first iteration measured 6,340 tok/s and it settled at 7,342 — a **15.8%** climb with nothing else changing. Two unrelated measurements landing on ~15% is strong evidence the effect is real. Consequences adopted here: - Tuned runs are compared **only** against a same-grid baseline. `summarize.py` labels any comparison forced to fall back to a different grid as `DIFFERENT grid -- warm-up confound possible`. - Sustained retention is reported against **peak**, not against the first iteration; `retention_vs_first` reads 115.5% on the H200 precisely because the first iteration is unrepresentative. - More generally: **a benchmark that quotes its first measurement understates by roughly 15%**, and two benchmarks both reporting "throughput at concurrency 32" are not comparable unless they reached 32 by the same path. The 1k/8k shape also uses 2 prompts per concurrency unit instead of 4, since each of its requests carries 8× the tokens. One exception, recorded for accuracy: the **8B stock sweep ran before that change** and used 4 throughout. This affects how long each point ran, not what it measured — throughput is a steady-state rate, and TTFT/TPOT are percentiles over completed requests. The exact prompt count for every point is in `num_prompts` inside each result JSON, so no point relies on this paragraph being remembered. ### Training specifics A self-contained Llama-3-shaped transformer rather than a HuggingFace model, so both machines provably execute the same graph with no version-dependent modelling code in between. Architecture matches Llama 3.1 8B exactly. Weights, gradients and optimizer state are all BF16. This is a fairness decision, not a convenience one: mixed precision with FP32 master weights would need ~112 GB for an 8B model, which fits the MI300X's 192 GB but **not** the H200's 141 GB. Choosing it would hand AMD a win by configuration rather than by silicon. MFU uses the torchtitan/PaLM convention, `6·N_nonembed + 12·L·heads·head_dim·seqlen` per token, scaled by 4/3 when gradient checkpointing recomputes the forward pass. Both boxes use the same seed and therefore the same synthetic batches, so the **loss traces must overlay**. If they do not, the throughput numbers are meaningless and the report says so instead of quoting them. ## Known limits - **The MI300X is an SR-IOV virtual function** (`MI300X VF`), not bare metal. It reports all 304 CUs, all 192 GB, SPX/NPS1 and full 750 W TBP, and it sustains 100% utilization at 751 W under load — so it behaves as a whole GPU. But virtualization overhead cannot be fully excluded, and the H200 is not virtualized in the same way. This is the single biggest caveat here. - **Different cloud providers**, therefore different host CPUs, RAM, kernels (Ubuntu 26.04 vs 24.04) and storage. Rule 7 covers the CPU lane; for GPU lanes the host matters mainly at high concurrency, which telemetry detects. - **One sample of each GPU.** No unit-to-unit variation is characterised. - **ROCm and CUDA are different stacks by definition.** Holding vLLM and PyTorch versions constant removes the framework variable but cannot remove the compiler, kernel-library and driver variable. That difference *is* part of what is being measured, and Run A vs Run B is the attempt to bound it. - **gpt-oss-120b uses MXFP4**, which neither gfx942 nor Hopper implements natively; both run kernel paths. If it fails to serve on either side, the lane is dropped and the failure documented rather than worked around asymmetrically on one side only. - **No multi-GPU, no training convergence.** Throughput is not time-to-accuracy; a stack can be fast per step and still converge worse.