Riptide kernels on AMD Instinct MI350X
Riptide's attention, decode and launch software for AMD Instinct MI350X (gfx950), measured in the same session as PyTorch 2.15 for ROCm, AITER, Triton and Hugging Face, with medians of 30 samples (10 runs for whole models), 95% bootstrap confidence intervals and a float64 check on every Riptide result.
Abstract
Riptide writes attention, decode and launch code for AMD Instinct GPUs that installs next to PyTorch for ROCm. On one MI350X, against the faster of PyTorch's FLASH (AOTriton) and EFFICIENT attention backends in the same session:
- Attention, head dim 64, bf16: forward 1.14–1.21× (full mask) and 1.25–1.39× (causal) at every length from 512 to 16,384 tokens, every confidence interval above 1; the training step (forward + backward) 1.04–1.93× full and 1.03–3.10× causal.
- Attention, head dim 128, bf16: causal training step at 512 tokens 3.32× [3.28, 3.38] (249 against 75 TFLOP/s); the training step ahead at 512–1,024 tokens (1.14–3.32×), behind from 4,096 tokens (0.82–0.90×).
- Against AITER's fastest correct backward (non-deterministic): head dim 64 training step 1.34–2.07× ahead; head dim 128 0.79–0.89×, behind.
- float32-accuracy attention training: 2.34–3.39× PyTorch's fastest float32 path, with lower error against float64 at every length.
- Generation, Qwen2.5-0.5B, one response at a time: 399 against 106 tokens per second for Hugging Face eager, 3.75× [3.73, 3.75].
- Kernel launch: 1.53 µs against 6.83 µs for an empty Triton kernel, 4.47× [4.46, 4.48]; level with PyTorch's
torch.cudagraphs for a tiny op.
Where AMD's kernels are still faster is stated alongside each result and collected at the end.
The problem
On a GPU the same maths can run at very different speeds depending on the kernel. Attention dominates transformer training at long sequences, and its backward pass is the hardest part to make fast and deterministic at once. At small sizes the opposite problem dominates: a 0.5-billion-parameter decode step is a few hundred small kernels, so the cost of launching them, not arithmetic or memory bandwidth, sets the speed. On the MI350X baseline, a Qwen2.5-0.5B decode step reads about 1 GB of weights, about 0.2 ms at the measured 5.5 TB/s, yet Hugging Face eager takes about 9 ms per token (106 tokens per second).
A faster kernel only counts if it computes the right answer. One of the baselines in this paper, AITER's deterministic backward, returned a wrong query gradient at long sequences; that case is documented in A silent gradient bug in AMD's attention kernels, and its timings are not used as a baseline here.
Method
Machine and software
One AMD Instinct MI350X (gfx950, 256 compute units, 1,000 W board limit) on RunPod: ROCm 10.2.0, amdgpu driver 7.1.3, Linux 6.12.107, PyTorch 2.15.0+rocm10.2.0 (HIP 7.17.26434), Triton 3.9.0, AOTriton 0.14.1, hipBLASLt 1.5.0, amd-aiter 0.1.7.post2.dev18. Runs: attention 20261119T185122Z (19 November), launch and decode 20261119T062450Z (19 November), AITER head-to-head (20 November), float32 and second-harness comparison (22 November). Every baseline ran on the same GPU in the same session as Riptide.
Baselines
- Attention: PyTorch's SDPA with its default dispatch, the forced
FLASH_ATTENTIONbackend (AOTriton on ROCm) andEFFICIENT_ATTENTION. "AMD's best" for a shape is the faster of FLASH and EFFICIENT in that session. AITER'sflash_attn_funcin both backward modes is compared separately. Riptide is called through PyTorch, so PyTorch's dispatch overhead is included in its times. - Generation: Hugging Face eager (
attn_implementation="sdpa"); the same model as a PyTorch static-cache implementation run eagerly, throughtorch.compileand as atorch.cudagraph. - Launch: PyTorch eager,
torch.cudagraphs and Triton.
Timing and statistics
- Device events around
innerback-to-back calls, withinnerchosen so one sample lasts at least 2 ms; 5 warm-up calls, then 30 timed samples (micro-benchmarks) or 10 full runs (end-to-end models). - Reported: the median per call and a 95% confidence interval of the median by percentile bootstrap (2,000 resamples, fixed seed). Rates are computed at the median. A ratio's interval is formed conservatively from the opposite ends of the two time intervals.
- Attention FLOPs: forward , halved when causal; forward + backward the forward. Every implementation is credited with the same FLOPs for the same call, so rates compare times.
- Energy:
amdsmiboard energy counter sampled every 50 ms over a sustained 1.5 s window of back-to-back calls.
Correctness against float64
- Forward: 64 sampled query rows of (batch 0, head 0) against float64 attention on the CPU, error ; tolerance in bf16, in fp16.
- Backward (up to 8,192 tokens): dQ, dK and dV of (batch 0, head 0) against float64 autograd on the CPU, ; tolerance in bf16, in fp16. At 16,384 tokens, PyTorch's math backend on the same inputs is the check.
- Kernel tests: every kernel configuration on odd shapes (1, 37, 129, 200 × 333 tokens and others), both masks, both dtypes, both head dims, strided inputs and custom scales; all passed on the MI350X in every session where they ran (162 of 162 on 20 November). The launch runtime's own 58 tests passed on the launch run's machine.
- Decode: teacher-forced on the Hugging Face bf16 greedy continuation and compared step by step with the model in float64 on the CPU.
Every Riptide row in this paper passed its check.
Results
Attention: head dim 64
| pass, mask | 512 | 1,024 | 2,048 | 4,096 | 8,192 | 16,384 |
|---|---|---|---|---|---|---|
| forward, full | 1.14× [1.09, 1.18] | 1.18× [1.14, 1.20] | 1.17× [1.14, 1.21] | 1.15× [1.10, 1.19] | 1.18× [1.13, 1.21] | 1.21× [1.19, 1.22] |
| forward, causal | 1.34× [1.26, 1.38] | 1.26× [1.20, 1.32] | 1.25× [1.22, 1.27] | 1.25× [1.19, 1.31] | 1.32× [1.28, 1.35] | 1.39× [1.38, 1.40] |
| training step, full | 1.93× [1.87, 1.97] | 1.05× [1.02, 1.09] | 1.04× [1.01, 1.12] | 1.06× [1.04, 1.08] | 1.06× [1.06, 1.07] | 1.07× [1.07, 1.08] |
| training step, causal | 3.10× [3.07, 3.14] | 1.03× [0.97, 1.06] | 1.04× [1.00, 1.08] | 1.14× [1.11, 1.17] | 1.05× [1.05, 1.07] | 1.11× [1.10, 1.11] |


At 16,384 tokens the head-dim-64 forward ran at 717 TFLOP/s (full) and 714 TFLOP/s (causal), against 594 and 515 for AMD's best. Its energy per call, measured against PyTorch's default dispatch, was 3.10 J against 3.68 J (16% less) with the full mask and 1.57 J against 2.12 J (26% less) causal. At head dim 128 the picture follows the speed: 2.73 J against 3.92 J causal, but 5.40 J against 4.53 J (19% more) with the full mask, where Riptide's forward is slower.

Attention: head dim 128
| pass, mask | 512 | 1,024 | 2,048 | 4,096 | 8,192 | 16,384 |
|---|---|---|---|---|---|---|
| forward, full | 0.84× [0.76, 0.87] | 0.87× [0.85, 0.89] | 0.89× [0.83, 0.92] | 1.02× [1.00, 1.05] | 0.87× [0.86, 0.88] | 0.84× [0.83, 0.84] |
| forward, causal | 1.12× [1.09, 1.16] | 1.13× [1.06, 1.16] | 1.06× [1.02, 1.13] | 0.87× [0.84, 0.90] | 0.87× [0.85, 0.89] | 0.86× [0.85, 0.87] |
| training step, full | 1.14× [1.10, 1.17] | 1.14× [1.12, 1.17] | 0.87× [0.84, 0.91] | 0.90× [0.89, 0.91] | 0.84× [0.83, 0.84] | 0.84× [0.84, 0.84] |
| training step, causal | 3.32× [3.28, 3.38] | 1.15× [1.10, 1.23] | 1.14× [1.12, 1.16] | 0.85× [0.83, 0.86] | 0.83× [0.83, 0.84] | 0.82× [0.81, 0.82] |



The 3.32× row is real but should be read with its baseline: at 512 tokens and batch 32, PyTorch's FLASH and EFFICIENT causal backward ran at 73–75 TFLOP/s, about 3% of the MI350X's 2,307 TFLOP/s dense bf16 peak, while Riptide's ran at 249 TFLOP/s. AITER's fastest backward is faster than Riptide's at a shape of that kind (next section). In fp16 at head dim 128 the forward was level with AMD's best for full masks (0.91–1.01×) and ahead for causal (1.09–1.21×); the training step followed the bf16 pattern (1.11–3.12× at 512–1,024 tokens, 1.15× causal at 2,048, and 0.87–0.91× at the longer lengths).
Against AITER
flash_attn_func, bf16, 32 heads, 16,384 tokens per batch, 20 November. AITER non-deterministic is its fastest backward (fp32 atomics); Riptide's backward is bit-for-bit repeatable. Training-step ratio [95% CI].| head dim | mask | 1,024 | 2,048 | 4,096 | 16,384 |
|---|---|---|---|---|---|
| 64 | full | 1.34× [1.31, 1.40] | 1.37× [1.34, 1.38] | 1.42× [1.39, 1.43] | 1.39× [1.38, 1.40] |
| 64 | causal | 1.51× [1.48, 1.54] | 1.87× [1.84, 1.88] | 2.07× [2.04, 2.10] | 1.61× [1.60, 1.62] |
| 128 | full | 0.86× [0.84, 0.88] | 0.81× [0.80, 0.82] | 0.85× [0.85, 0.86] | 0.82× [0.81, 0.84] |
| 128 | causal | 0.89× [0.87, 0.91] | 0.86× [0.86, 0.87] | 0.79× [0.78, 0.80] | 0.82× [0.82, 0.83] |

Forward only, Riptide was 1.05–1.13× AITER at head dim 64 and 0.83–1.03× at head dim 128. Repeating each backward twice on the same inputs, Riptide and AITER's deterministic mode were bit-for-bit repeatable on 16 of 16 shapes and AITER's non-deterministic mode on 1 of 16. In a second harness on 22 November (batch 4, 32 heads, causal), AITER's fastest mode was ahead of Riptide at head dim 128 at every length from 512 to 8,192 tokens (Riptide 0.70–0.94×), including 512 tokens (0.70×), the shape class of the 3.32× row above.
Attention at float32 accuracy
| tokens | Riptide | error | PyTorch fastest (backend) | error | ratio [95% CI] |
|---|---|---|---|---|---|
| 1,024 | 1.479 ms | 5.9e-7 | 3.458 ms (default) | 8.2e-7 | 2.34× [2.32, 2.36] |
| 2,048 | 3.636 ms | 7.5e-7 | 12.332 ms (default) | 1.1e-6 | 3.39× [3.35, 3.44] |
| 4,096 | 12.254 ms | 1.0e-6 | 36.282 ms (EFFICIENT) | 1.4e-6 | 2.96× [2.95, 2.98] |
| 8,192 | 44.844 ms | 1.4e-6 | 134.706 ms (EFFICIENT) | 1.9e-6 | 3.00× [3.00, 3.01] |

The same harness also ran tinygrad 0.14.0 (best of TinyJit and eager), which was correct and 2.4–23× slower than Riptide in bf16 and 9.9–21.5× slower in float32.
Generation: Qwen2.5-0.5B
torch.cuda graph row's prefill.| prompt, batch | Hugging Face eager | torch.compile* | torch.cuda graph* | Riptide | vs Hugging Face | vs torch.compile* |
|---|---|---|---|---|---|---|
| 128, 1 | 106 [106, 107] | 291 [290, 293] | 247 | 399 [399, 399] | 3.75× [3.73, 3.75] | 1.37× [1.36, 1.38] |
| 1,024, 1 | 111 [111, 112] | 296 [295, 297] | 246 | 315 [315, 315] | 2.83× [2.82, 2.83] | 1.06× [1.06, 1.07] |
| 128, 8 | 878 [873, 879] | 2,167 [2,152, 2,169] | 1,614 | 2,072 [2,071, 2,073] | 2.36× [2.36, 2.38] | 0.96× [0.95, 0.96] |
| 1,024, 8 | 860 [858, 865] | 2,215 [2,208, 2,224] | 1,614 | 1,741 [1,739, 1,741] | 2.02× [2.01, 2.03] | 0.79× [0.78, 0.79] |

\* The torch.compile and torch.cuda graph rows run the PyTorch static-cache model. Its eager decode step failed the teacher-forced float64 check (normwise logit error 0.915, near-tie agreement 0.32), and the compiled step was not checked separately, so those rows are unverified. Hugging Face eager passed (logit error 0.0450) and is the verified baseline; Riptide's decode passed (0.0439, near-tie agreement 1.00). Time to first token was the same as the torch.cuda graph prefill (4.72 against 4.71 ms at prompt 128, batch 1), because the prefill is the same.
Launch cost and a small training step
| row | AMD's stack, best | Riptide, best | ratio [95% CI] |
|---|---|---|---|
| empty kernel, asynchronous | Triton 6.83 [6.82, 6.84] | mode A 1.53 [1.53, 1.53] | 4.47× [4.46, 4.48] |
tiny op (x += v), asynchronous | torch.cuda graph 1.55; eager 3.16 | mode A 1.53 | 1.01× [1.01, 1.02] |
| tiny op, launch + wait | PyTorch eager 12.67 | mode B 11.71 | 1.08× [1.08, 1.08] |
| dependent chain of 1,000, per chain | torch.cuda graph 1,691 | mode A 1,653 | 1.02× [1.02, 1.02] |
| MNIST MLP training step, loss read every step | torch.cuda graph 0.225 ms | mode A 0.127 ms | 1.76× [1.59, 1.90] |
| MNIST CNN training step | torch.cuda graph 0.284 ms | 0.287 ms | 0.99× [0.99, 0.99] |



Every launch row checks counts and values exactly, and every training row passed its float64 criterion (first loss, first 50 losses, accuracy).
Limitations and next steps
The limits of these results, each with its cause and, where one is planned, the next step.
- Head dim 128 at 4,096 tokens and longer: 0.82–0.90× of PyTorch's best for the bf16 training step and 0.84–0.87× forward (except the full-mask forward at 4,096 tokens, 1.02×), where AMD's kernels are strongest. Cause: the backward share is the cost of staying deterministic (next item); the forward limit was measured inside Riptide's kernel, not in memory bandwidth, and is being worked on.
- Against AITER's non-deterministic backward at head dim 128: 0.79–0.89× at 1,024–16,384 tokens (32 heads), and 0.70–0.94× at 512–8,192 tokens (batch 4). Cause: this is AITER's fastest mode, which gives up bit-for-bit repeatability; Riptide's backward is deterministic and does more work to stay so, which the notes identify as most of the gap. The timing gap stands.
- Second harness (22 November, batch 4, causal): 0.63× [0.62, 0.65] of PyTorch's best at head dim 64, 1,024 tokens, and 0.87–0.93× at head dim 128, 1,024, 4,096 and 8,192 tokens. Cause: under investigation.
- Head dim 128 forward, full mask, at 512–2,048 and 8,192–16,384 tokens: 0.84–0.89×. Cause: under investigation.
- Decode at batch 8 against
torch.compile(unverified baseline): 0.96× at prompt 128 and 0.79× at prompt 1,024. Cause: Riptide's batch-8 decode does not yet reuse the weights across the batch as well astorch.compiledoes, and attention over a long cache is slower. Batch-8 decode and decode over a long cache are open work. - Decode is far from the memory floor: a batch-1 step takes 2.5 ms, about 12× the ~0.2 ms needed to read the weights once. Cause: launching is now a small part of the step; the rest is in the decode kernels, which are the next work.
- Energy at head dim 128, full mask: 5.40 J per forward call against 4.53 J for PyTorch's default dispatch at 16,384 tokens. Cause: under investigation.
- Riptide's launch mode B is 2.9× slower per dependent kernel than mode A (4.77 against 1.65 ms per 1,000-kernel chain), and a decode step in mode B takes 15–25% longer than in mode A. Cause: under investigation; mode A is the one to use for dependent chains.
- Launch of a tiny op and of dependent chains is level with
torch.cudagraphs; the 4.47× is against Triton's launch path for an empty kernel. - The MNIST CNN step is level (Riptide has no dedicated CNN kernels yet), and time to first token is unchanged (the prompt is processed by the same PyTorch code).
- Scope: one MI350X, measured 19–22 November 2026; not re-run since. The MI300X (gfx942) port was not part of these runs.
Reproduction notes
- Harness. Every phase runs on a rented GPU with the same statistics for AMD's software and for Riptide. Each run records ROCm, driver, kernel, firmware, clocks, PyTorch, Triton and library versions, and a manifest lists every output file with its SHA-256.
- Peak. "% of peak" uses AMD's published dense peak for the GPU (MI350X bf16/fp16: 2,306.9 TFLOP/s).
- Availability. Riptide's AMD kernels are available for evaluation, installed next to PyTorch for ROCm, through Request an evaluation; full results and raw data are shared with evaluation partners.
Date and version
Version 1.1, 30 November 2026. Measurements from 19, 20 and 22 November 2026. Updated 1 December 2026: limitations section retitled.
Working with Riptide
Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.