Where RAPTOR fits#
See which kinds of GPU problems RAPTOR makes easy, and when another tool is the better choice — see the front page for the elevator pitch and the headline numbers; this page is the longer story: where RAPTOR sits, what it is not, and the same task in five tools, side by side.
The four principles#
Efficient on the GPU. Whole pipelines replay as CUDA graphs — a GPU’s sequence of launches recorded once and replayed without re-issuing each one — so dense batches approach the hardware’s peak.
Written at the level of your application. A hawk kernel (a small GPU/CPU function, written once per sample) runs once per sample and declares, in its own signature, what each argument is (a per-sample state, a read-only table, an output); hawk works out the launch layout from that. CUDA C++, Warp, Numba and Triton still work right alongside it.
Differentiable, forward and backward. Every kernel written in hawk’s own vocabulary gets reverse- and forward-mode derivatives generated from the same source and run on the GPU or the CPU like the kernel itself.
Works with the code you already have. Arrays cross without copies through DLPack (a standard, framework-neutral way for one library to hand another an array without copying it), and a compiled kernel deploys into any program that can load its manifest (the family’s shared words are in one glossary). Both directions work: a hawk kernel runs inside your JAX, PyTorch, Warp or CuPy and NumPy program, on CPU and GPU, and your code runs as a step inside an eagle batch.
The shape of it#
Every tool is strong somewhere. Pick the hardware and the device. Each axis is defined under the chart, and hovering one shows where its number comes from. Switch tools on and off to compare.
- 1 Uneven ensembles faster is better
- 2 Regular ensembles faster is better
- 3 Small jobs faster is better
- 4 Adaptive ODEs faster is better
- 5 Memory smaller is better
- 6 Compile time lower is better
- 7 Code size smaller is better
- 8 Tensor workloads (qualitative)
- 9 Array-style programming (qualitative)
- 10 Half precision and below (qualitative)
- 11 Single-thread abstraction (qualitative)
- 12 Differentiable kernels (qualitative)
- 13 Low-level control (qualitative)
- 14 Works with your arrays (qualitative)
- 15 Deploy outside Python (qualitative)
- 16 Extensibility (qualitative)
- 17 Wide values faster is better
- 18 Fused steps faster is better
- 19 Control flow faster is better
- 20 Small linear algebra, per lane faster is better
- 21 Small linear algebra, per team faster is better
- 22 Contractions faster is better
- 23 FFT faster is better
- 24 Scatter faster is better
- 25 Reductions faster is better
- Uneven ensembles
- How long a batch takes when every sample stops at its own step, at N = 1,000,000.
- Regular ensembles
- How long a batch takes when every sample runs the same orbit, at N = 1,000,000.
- Small jobs
- Wall time of the smallest batch (N = 1,000), where launch overhead matters most. Not re-measured by the 0.7.3 cards: the value is from the earlier card named in the axis note.
- Adaptive ODEs
- Wall time of an adaptive-step orbit propagator (RK7(8)) at N = 1,000,000. Not re-measured as a separate card in 0.7.3: the value is from the earlier card named in the axis note.
- Memory
- Peak memory the process holds for the same workload (device memory on a GPU; host memory on a CPU, net of the benchmark harness's control copy).
- Compile time
- Cold compile of the adaptive kernel on empty caches. Not re-measured by the 0.7.3 cards: the value is from the earlier card named in the axis note.
- Code size
- Lines of code the task takes, non-blank and non-comment.
- Tensor workloads (qualitative)
- Tensor workloads (qualitative): how naturally a tool expresses dense array maths (batched linear algebra, convolutions, broadcasting) and how much of it its tuned libraries cover. 5 = this is its home ground.
- Array-style programming (qualitative)
- Array-style programming (qualitative): how naturally you write whole-array expressions eagerly, the NumPy way. 5 = the array expression is the programming model. Scores are the author's judgement.
- Half precision and below (qualitative)
- Half precision and below (qualitative): FP16, BF16, FP8 and FP4 arithmetic and tensor cores (FP32 and FP64 are measured on the other axes). 5 = these formats and tensor cores are first-class paths. Scores are the author's judgement.
- Single-thread abstraction (qualitative)
- Single-thread abstraction (qualitative): how fully you can write the code for one sample, one step, and let the tool run it over the batch: threads, launches, early stopping and scheduling included. 5 = you write one sample and nothing else. Scores are the author's judgement.
- Differentiable kernels (qualitative)
- Differentiable kernels (qualitative): how directly you get forward- and reverse-mode derivatives of your own kernels, on GPU and on CPU. 5 = built in for every kernel written in the tool's own vocabulary.
- Low-level control (qualitative)
- Low-level control (qualitative): how much of the GPU's execution you control from the tool's own language: thread indexing, shared memory, atomics, launch shape, synchronisation (raw CUDA/C++ not counted). 5 = you write what each thread does and how it is launched. On a CPU the same question is asked of threads, SIMD and memory layout. Scores are the author's judgement.
- Works with your arrays (qualitative)
- Works with your arrays (qualitative): how freely arrays move to and from other frameworks without copies. 5 = zero-copy exchange is the norm.
- Deploy outside Python (qualitative)
- Deploy outside Python (qualitative): whether a compiled kernel can run from programs that are not Python. 5 = a compiled artefact any program can load.
- Extensibility (qualitative)
- Extensibility (qualitative): how readily new hardware, backends and features can be added without losing speed. 5 = a documented plugin path across many targets. Scores are the author's judgement.
- Wide values
- Wall time of samples that hold a vector of values at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Fused steps
- Wall time of several integration steps fused into one launch at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Control flow
- Wall time of branches and early exits inside a kernel at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Small linear algebra, per lane
- Wall time of one small matrix per lane at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Small linear algebra, per team
- Wall time of one matrix shared by a team of lanes at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Contractions
- Wall time of small tensor contractions at the feature card's float64 row: our best arm against the best arm of each library the row records.
- FFT
- Wall time of a batched FFT at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Scatter
- Wall time of adding values into bins by key at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Reductions
- Wall time of summing over samples at the feature card's float64 row: our best arm against the best arm of each library the row records.
Radar for NVIDIA H100 NVL, card of 2026-11-05, script a69639ae. Each axis is defined in the list below the chart; hover or tap one for the numbers behind it.
Show the data behind the radar
| Axis | raptor | NVIDIA Warp | JAX | PyTorch | CuPy |
|---|---|---|---|---|---|
| Uneven ensembles | 48.9 ms (1.0× the best) | 113 ms (2.3× the best) | 1.24 s (25× the best) | 811 ms (16× the best) | 9.34 s (190× the best) |
| Regular ensembles | 40.8 ms (1.0× the best) | 55.1 ms (1.3× the best) | 588 ms (14× the best) | 378 ms (9.2× the best) | 4.87 s (110× the best) |
| Small jobs | 103 µs (1.0× the best) | 112 µs (1.0× the best) | 21.8 ms (210× the best) | 65.7 ms (630× the best) | 352 ms (3400× the best) |
| Adaptive ODEs | 43.6 ms (1.0× the best) | 101 ms (2.3× the best) | 1.11 s (25× the best) | 7.17 s (160× the best) | 9.06 s (200× the best) |
| Memory | 102 MiB (1.0× the best) | 94 MiB (1.0× the best) | 890 MiB (9.4× the best) | 1506 MiB (16× the best) | 936 MiB (9.9× the best) |
| Compile time | 2.48 s (1.0× the best) | 9.28 s (3.7× the best) | 4.22 s (1.7× the best) | 3.71 s (1.4× the best) | 2.58 s (1.0× the best) |
| Code size | 21 lines (1.0× the best) | 74 lines (3.5× the best) | 25 lines (1.1× the best) | 46 lines (2.1× the best) | 25 lines (1.1× the best) |
| Tensor workloads (qualitative) | 2 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 4 of 5 |
| Array-style programming (qualitative) | 2 of 5 | 2 of 5 | 4 of 5 | 5 of 5 | 5 of 5 |
| Half precision and below (qualitative) | 1 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 3 of 5 |
| Single-thread abstraction (qualitative) | 5 of 5 | 3 of 5 | 4 of 5 | 3 of 5 | 2 of 5 |
| Differentiable kernels (qualitative) | 5 of 5 | 4 of 5 | 5 of 5 | 4 of 5 | 1 of 5 |
| Low-level control (qualitative) | 3 of 5 | 5 of 5 | 3 of 5 | 2 of 5 | 3 of 5 |
| Works with your arrays (qualitative) | 4 of 5 | 4 of 5 | 4 of 5 | 4 of 5 | 5 of 5 |
| Deploy outside Python (qualitative) | 4 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 1 of 5 |
| Extensibility (qualitative) | 3 of 5 | 2 of 5 | 4 of 5 | 4 of 5 | 2 of 5 |
| Wide values | 979 µs (2.5× the best) | – | – | 378 µs (1.0× the best) | – |
| Fused steps | 616 µs (1.0× the best) | 21.5 ms (34× the best) | – | 1.13 ms (1.8× the best) | – |
| Control flow | 10.6 ms (1.1× the best) | 9.43 ms (1.0× the best) | – | – | – |
| Small linear algebra, per lane | 1.66 ms (1.0× the best) | – | – | – | 6.44 ms (3.8× the best) |
| Small linear algebra, per team | 65.5 ms (10× the best) | – | – | 5.97 ms (1.0× the best) | 19.8 ms (3.3× the best) |
| Contractions | 28.7 µs (1.0× the best) | – | – | – | – |
| FFT | 1.08 ms (1.0× the best) | – | – | – | 1.14 ms (1.0× the best) |
| Scatter | 393 µs (1.1× the best) | – | – | – | 333 µs (1.0× the best) |
| Reductions | 185 µs (2.6× the best) | – | – | – | 71.3 µs (1.0× the best) |
Radar for NVIDIA L4, card of 2026-11-04, script a69639ae. Each axis is defined in the list below the chart; hover or tap one for the numbers behind it.
Show the data behind the radar
| Axis | raptor | NVIDIA Warp | JAX | PyTorch | CuPy |
|---|---|---|---|---|---|
| Uneven ensembles | 2.32 s (1.0× the best) | 4.26 s (1.8× the best) | 7.24 s (3.1× the best) | 55.3 s (23× the best) | 52.8 s (22× the best) |
| Regular ensembles | 1.97 s (1.0× the best) | 2.16 s (1.0× the best) | 3.36 s (1.7× the best) | 26.6 s (13× the best) | 25.1 s (12× the best) |
| Small jobs | 441 µs (1.0× the best) | 1.64 ms (3.7× the best) | 17.6 ms (39× the best) | 64.3 ms (140× the best) | 656 ms (1400× the best) |
| Adaptive ODEs | 2.32 s (1.0× the best) | 4.27 s (1.8× the best) | 7.27 s (3.1× the best) | 55.0 s (23× the best) | 52.8 s (22× the best) |
| Memory | 102 MiB (1.0× the best) | 94 MiB (1.0× the best) | 266 MiB (2.8× the best) | 1340 MiB (14× the best) | 936 MiB (9.9× the best) |
| Compile time | 3.81 s (1.0× the best) | 12.3 s (3.2× the best) | 4.68 s (1.2× the best) | 6.70 s (1.7× the best) | 4.03 s (1.0× the best) |
| Code size | 21 lines (1.0× the best) | 74 lines (3.5× the best) | 25 lines (1.1× the best) | 46 lines (2.1× the best) | 25 lines (1.1× the best) |
| Tensor workloads (qualitative) | 2 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 4 of 5 |
| Array-style programming (qualitative) | 2 of 5 | 2 of 5 | 4 of 5 | 5 of 5 | 5 of 5 |
| Half precision and below (qualitative) | 1 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 3 of 5 |
| Single-thread abstraction (qualitative) | 5 of 5 | 3 of 5 | 4 of 5 | 3 of 5 | 2 of 5 |
| Differentiable kernels (qualitative) | 5 of 5 | 4 of 5 | 5 of 5 | 4 of 5 | 1 of 5 |
| Low-level control (qualitative) | 3 of 5 | 5 of 5 | 3 of 5 | 2 of 5 | 3 of 5 |
| Works with your arrays (qualitative) | 4 of 5 | 4 of 5 | 4 of 5 | 4 of 5 | 5 of 5 |
| Deploy outside Python (qualitative) | 4 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 1 of 5 |
| Extensibility (qualitative) | 3 of 5 | 2 of 5 | 4 of 5 | 4 of 5 | 2 of 5 |
| Wide values | 8.06 ms (1.0× the best) | – | – | 8.66 ms (1.0× the best) | – |
| Fused steps | 5.49 ms (1.0× the best) | 199 ms (36× the best) | – | 46.8 ms (8.5× the best) | – |
| Control flow | 382 ms (1.0× the best) | 404 ms (1.0× the best) | – | – | – |
| Small linear algebra, per lane | 10.4 ms (1.0× the best) | – | – | – | 117 ms (11× the best) |
| Small linear algebra, per team | 62.0 ms (6.5× the best) | – | – | 9.49 ms (1.0× the best) | 39.3 ms (4.1× the best) |
| Contractions | 74.5 µs (1.0× the best) | – | – | – | – |
| FFT | 19.6 ms (1.0× the best) | – | – | – | 19.8 ms (1.0× the best) |
| Scatter | 576 µs (1.5× the best) | – | – | – | 374 µs (1.0× the best) |
| Reductions | 802 µs (1.2× the best) | – | – | – | 647 µs (1.0× the best) |
Every measured axis is the per-sample ensemble workload raptor is built for; dense tensor maths, training and half precision are the qualitative axes, where PyTorch and JAX lead. Outer is better; overlaps are complementary, not a ranking.
NVIDIA Warp gives you near-total control of every kernel, short of raw CUDA. raptor hands that control to the engine on purpose, so compaction and the launch shape are decided at run time; the two are different trade-offs, not a ranking.
How to read this radar
Each of the seven majors is the plain mean of its minor axes (the detailed radar draws every minor), with equal weights and the same rule for every tool; a minor a tool has no reading on is left out of its mean and the major's marker is drawn hollow. Hover or tap a major to see its minors.
- Ensemble speed: Uneven ensembles, Regular ensembles, Small jobs and Adaptive ODEs; measured.
- Footprint and turnaround: Memory, Compile time and Code size; measured.
- Capabilities: Wide values, Fused steps, Control flow, Small linear algebra, per lane, Small linear algebra, per team, Contractions, FFT, Scatter and Reductions; measured.
- Tensors and precision: Tensor workloads, Array-style programming and Half precision and below; qualitative.
- One-sample authoring: Single-thread abstraction and Differentiable kernels; qualitative.
- Low-level control: A single axis, so nothing is averaged; qualitative.
- Reach: Works with your arrays, Deploy outside Python and Extensibility; qualitative.
Each measured axis is stretched over its own best-to-worst range, so ring labels differ per axis (code size: at least 4x). Axes are grouped by theme, so read the axes, not the area.
Italic axes are the author's judgement, not measurements: hollow markers, a linear scale, and no marker where a tool has no reading. A hollow marker on a measured axis means a minor is missing. The hover panel has each axis's full wording.
- Tensor workloads: 5 = dense array maths, batched linear algebra and convolutions are its home ground.
- Array-style programming: 5 = the whole-array expression is the programming model.
- Half precision and below: 5 = FP16, BF16, FP8, FP4 and tensor cores are first-class paths.
- Single-thread abstraction: 5 = you write one sample and nothing else.
- Differentiable kernels: 5 = derivatives are built in for every kernel written in the tool.
- Low-level control: 5 = you write what each thread does and how it is launched.
- Works with your arrays: 5 = zero-copy exchange with other frameworks is the norm.
- Deploy outside Python: 5 = a compiled artefact any program can load.
- Extensibility: 5 = a documented plugin path across many targets.
- 1 Uneven ensembles faster is better
- 2 Regular ensembles faster is better
- 3 Small jobs faster is better
- 4 Adaptive ODEs faster is better
- 5 Memory smaller is better
- 6 Compile time lower is better
- 7 Code size smaller is better
- 8 Tensor workloads (qualitative)
- 9 Array-style programming (qualitative)
- 10 Half precision and below (qualitative)
- 11 Single-thread abstraction (qualitative)
- 12 Differentiable kernels (qualitative)
- 13 Low-level control (qualitative)
- 14 Works with your arrays (qualitative)
- 15 Deploy outside Python (qualitative)
- 16 Extensibility (qualitative)
- 17 Wide values faster is better
- 18 Fused steps faster is better
- 19 Control flow faster is better
- 20 Small linear algebra, per lane faster is better
- 21 Small linear algebra, per team faster is better
- 22 Contractions faster is better
- 23 FFT faster is better
- 24 Scatter faster is better
- 25 Reductions faster is better
- Uneven ensembles
- How long a batch takes when every sample stops at its own step, at N = 1,000,000.
- Regular ensembles
- How long a batch takes when every sample runs the same orbit, at N = 1,000,000.
- Small jobs
- Wall time of the smallest batch (N = 1,000), where launch overhead matters most. Not re-measured by the 0.7.3 cards: the value is from the earlier card named in the axis note.
- Adaptive ODEs
- Wall time of an adaptive-step orbit propagator (RK7(8)) at N = 1,000,000. Not re-measured as a separate card in 0.7.3: the value is from the earlier card named in the axis note.
- Memory
- Peak memory the process holds for the same workload (device memory on a GPU; host memory on a CPU, net of the benchmark harness's control copy).
- Compile time
- Cold compile of the adaptive kernel on empty caches. Not re-measured by the 0.7.3 cards: the value is from the earlier card named in the axis note.
- Code size
- Lines of code the task takes, non-blank and non-comment.
- Tensor workloads (qualitative)
- Tensor workloads (qualitative): how naturally a tool expresses dense array maths (batched linear algebra, convolutions, broadcasting) and how much of it its tuned libraries cover. 5 = this is its home ground.
- Array-style programming (qualitative)
- Array-style programming (qualitative): how naturally you write whole-array expressions eagerly, the NumPy way. 5 = the array expression is the programming model. Scores are the author's judgement.
- Half precision and below (qualitative)
- Half precision and below (qualitative): FP16, BF16, FP8 and FP4 arithmetic and tensor cores (FP32 and FP64 are measured on the other axes). 5 = these formats and tensor cores are first-class paths. Scores are the author's judgement.
- Single-thread abstraction (qualitative)
- Single-thread abstraction (qualitative): how fully you can write the code for one sample, one step, and let the tool run it over the batch: threads, launches, early stopping and scheduling included. 5 = you write one sample and nothing else. Scores are the author's judgement.
- Differentiable kernels (qualitative)
- Differentiable kernels (qualitative): how directly you get forward- and reverse-mode derivatives of your own kernels, on GPU and on CPU. 5 = built in for every kernel written in the tool's own vocabulary.
- Low-level control (qualitative)
- Low-level control (qualitative): how much of the GPU's execution you control from the tool's own language: thread indexing, shared memory, atomics, launch shape, synchronisation (raw CUDA/C++ not counted). 5 = you write what each thread does and how it is launched. On a CPU the same question is asked of threads, SIMD and memory layout. Scores are the author's judgement.
- Works with your arrays (qualitative)
- Works with your arrays (qualitative): how freely arrays move to and from other frameworks without copies. 5 = zero-copy exchange is the norm.
- Deploy outside Python (qualitative)
- Deploy outside Python (qualitative): whether a compiled kernel can run from programs that are not Python. 5 = a compiled artefact any program can load.
- Extensibility (qualitative)
- Extensibility (qualitative): how readily new hardware, backends and features can be added without losing speed. 5 = a documented plugin path across many targets. Scores are the author's judgement.
- Wide values
- Wall time of samples that hold a vector of values at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Fused steps
- Wall time of several integration steps fused into one launch at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Control flow
- Wall time of branches and early exits inside a kernel at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Small linear algebra, per lane
- Wall time of one small matrix per lane at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Small linear algebra, per team
- Wall time of one matrix shared by a team of lanes at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Contractions
- Wall time of small tensor contractions at the feature card's float64 row: our best arm against the best arm of each library the row records.
- FFT
- Wall time of a batched FFT at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Scatter
- Wall time of adding values into bins by key at the feature card's float64 row: our best arm against the best arm of each library the row records.
- Reductions
- Wall time of summing over samples at the feature card's float64 row: our best arm against the best arm of each library the row records.
Radar for AMD EPYC 9B45, card of 2026-11-10, script 988fa118. Each axis is defined in the list below the chart; hover or tap one for the numbers behind it.
Show the data behind the radar
| Axis | raptor | Numba | JAX | PyTorch | NumPy |
|---|---|---|---|---|---|
| Uneven ensembles | 2.49 s (1.0× the best) | 19.6 s (7.8× the best) | 60.5 s (24× the best) | – | – |
| Regular ensembles | 2.06 s (1.0× the best) | 17.8 s (8.6× the best) | 28.8 s (13× the best) | – | – |
| Small jobs | 167 µs (1.0× the best) | 368 µs (2.1× the best) | 491 µs (2.9× the best) | 44.7 ms (260× the best) | 15.6 ms (92× the best) |
| Adaptive ODEs | 3.76 s (1.0× the best) | 19.9 s (5.3× the best) | 60.5 s (16× the best) | – | – |
| Memory | – | – | – | – | – |
| Compile time | 565 ms (7.8× the best) | 449 ms (6.2× the best) | 71.5 ms (1.0× the best) | – | – |
| Code size | 22 lines (1.0× the best) | 58 lines (2.6× the best) | 25 lines (1.1× the best) | – | 23 lines (1.0× the best) |
| Tensor workloads (qualitative) | 2 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 4 of 5 |
| Array-style programming (qualitative) | 2 of 5 | 2 of 5 | 4 of 5 | 5 of 5 | 5 of 5 |
| Half precision and below (qualitative) | 1 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 3 of 5 |
| Single-thread abstraction (qualitative) | 5 of 5 | 3 of 5 | 4 of 5 | 3 of 5 | 1 of 5 |
| Differentiable kernels (qualitative) | 5 of 5 | 1 of 5 | 5 of 5 | 4 of 5 | 1 of 5 |
| Low-level control (qualitative) | 3 of 5 | 5 of 5 | 2 of 5 | 2 of 5 | 2 of 5 |
| Works with your arrays (qualitative) | 4 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 4 of 5 |
| Deploy outside Python (qualitative) | 4 of 5 | 2 of 5 | 4 of 5 | 4 of 5 | 1 of 5 |
| Extensibility (qualitative) | 3 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 3 of 5 |
| Wide values | 90.5 ms (1.9× the best) | – | – | 47.5 ms (1.0× the best) | 105 ms (2.2× the best) |
| Fused steps | 259 ms (2.5× the best) | – | – | 101 ms (1.0× the best) | – |
| Control flow | 694 ms (1.0× the best) | – | – | – | – |
| Small linear algebra, per lane | 41.2 ms (1.0× the best) | – | – | 299 ms (7.2× the best) | – |
| Small linear algebra, per team | – | – | – | – | – |
| Contractions | 78.8 µs (1.0× the best) | – | – | – | – |
| FFT | – | – | – | – | – |
| Scatter | 9.80 ms (2.2× the best) | – | – | – | 4.36 ms (1.0× the best) |
| Reductions | 3.63 ms (1.0× the best) | – | – | – | – |
Radar for Intel Xeon W-2125, card of 2026-11-10, script 988fa118. Each axis is defined in the list below the chart; hover or tap one for the numbers behind it.
Show the data behind the radar
| Axis | raptor | Numba | JAX | PyTorch | NumPy |
|---|---|---|---|---|---|
| Uneven ensembles | 6.02 s (1.0× the best) | 55.0 s (9.1× the best) | 118 s (19× the best) | – | – |
| Regular ensembles | 4.92 s (1.0× the best) | 47.2 s (9.5× the best) | 56.4 s (11× the best) | – | – |
| Small jobs | – | – | – | – | – |
| Adaptive ODEs | – | – | – | – | – |
| Memory | – | – | – | – | – |
| Compile time | – | – | – | – | – |
| Code size | 22 lines (1.0× the best) | 58 lines (2.6× the best) | 25 lines (1.1× the best) | – | 23 lines (1.0× the best) |
| Tensor workloads (qualitative) | 2 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 4 of 5 |
| Array-style programming (qualitative) | 2 of 5 | 2 of 5 | 4 of 5 | 5 of 5 | 5 of 5 |
| Half precision and below (qualitative) | 1 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 3 of 5 |
| Single-thread abstraction (qualitative) | 5 of 5 | 3 of 5 | 4 of 5 | 3 of 5 | 1 of 5 |
| Differentiable kernels (qualitative) | 5 of 5 | 1 of 5 | 5 of 5 | 4 of 5 | 1 of 5 |
| Low-level control (qualitative) | 3 of 5 | 5 of 5 | 2 of 5 | 2 of 5 | 2 of 5 |
| Works with your arrays (qualitative) | 4 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 4 of 5 |
| Deploy outside Python (qualitative) | 4 of 5 | 2 of 5 | 4 of 5 | 4 of 5 | 1 of 5 |
| Extensibility (qualitative) | 3 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 3 of 5 |
| Wide values | – | – | – | – | – |
| Fused steps | – | – | – | – | – |
| Control flow | – | – | – | – | – |
| Small linear algebra, per lane | – | – | – | – | – |
| Small linear algebra, per team | – | – | – | – | – |
| Contractions | – | – | – | – | – |
| FFT | – | – | – | – | – |
| Scatter | – | – | – | – | – |
| Reductions | – | – | – | – | – |
Radar for Apple M4 Pro, card of 2026-11-10, script 988fa118. Each axis is defined in the list below the chart; hover or tap one for the numbers behind it.
Show the data behind the radar
| Axis | raptor | Numba | JAX | PyTorch | NumPy |
|---|---|---|---|---|---|
| Uneven ensembles | 2.67 s (1.0× the best) | 17.1 s (6.3× the best) | 33.9 s (12× the best) | – | – |
| Regular ensembles | 2.40 s (1.0× the best) | 15.0 s (6.2× the best) | 16.0 s (6.6× the best) | – | – |
| Small jobs | – | – | – | – | – |
| Adaptive ODEs | – | – | – | – | – |
| Memory | – | – | – | – | – |
| Compile time | – | – | – | – | – |
| Code size | 22 lines (1.0× the best) | 58 lines (2.6× the best) | 25 lines (1.1× the best) | – | 23 lines (1.0× the best) |
| Tensor workloads (qualitative) | 2 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 4 of 5 |
| Array-style programming (qualitative) | 2 of 5 | 2 of 5 | 4 of 5 | 5 of 5 | 5 of 5 |
| Half precision and below (qualitative) | 1 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 3 of 5 |
| Single-thread abstraction (qualitative) | 5 of 5 | 3 of 5 | 4 of 5 | 3 of 5 | 1 of 5 |
| Differentiable kernels (qualitative) | 5 of 5 | 1 of 5 | 5 of 5 | 4 of 5 | 1 of 5 |
| Low-level control (qualitative) | 3 of 5 | 5 of 5 | 2 of 5 | 2 of 5 | 2 of 5 |
| Works with your arrays (qualitative) | 4 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 4 of 5 |
| Deploy outside Python (qualitative) | 4 of 5 | 2 of 5 | 4 of 5 | 4 of 5 | 1 of 5 |
| Extensibility (qualitative) | 3 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 3 of 5 |
| Wide values | – | – | – | – | – |
| Fused steps | – | – | – | – | – |
| Control flow | – | – | – | – | – |
| Small linear algebra, per lane | – | – | – | – | – |
| Small linear algebra, per team | – | – | – | – | – |
| Contractions | – | – | – | – | – |
| FFT | – | – | – | – | – |
| Scatter | – | – | – | – | – |
| Reductions | – | – | – | – | – |
Radar for Google Axion (Arm Neoverse-V2), card of 2026-11-10, script 988fa118. Each axis is defined in the list below the chart; hover or tap one for the numbers behind it.
Show the data behind the radar
| Axis | raptor | Numba | JAX | PyTorch | NumPy |
|---|---|---|---|---|---|
| Uneven ensembles | 7.17 s (1.0× the best) | 22.6 s (3.1× the best) | 62.3 s (8.6× the best) | – | – |
| Regular ensembles | 6.11 s (1.0× the best) | 19.2 s (3.1× the best) | 29.9 s (4.8× the best) | – | – |
| Small jobs | 407 µs (1.0× the best) | 438 µs (1.0× the best) | 803 µs (1.9× the best) | 62.9 ms (150× the best) | 16.9 ms (41× the best) |
| Adaptive ODEs | 13.3 s (1.0× the best) | 22.5 s (1.6× the best) | 41.6 s (3.1× the best) | – | – |
| Memory | – | – | – | – | – |
| Compile time | 297 ms (3.5× the best) | 520 ms (6.2× the best) | 83.7 ms (1.0× the best) | – | – |
| Code size | 22 lines (1.0× the best) | 58 lines (2.6× the best) | 25 lines (1.1× the best) | – | 23 lines (1.0× the best) |
| Tensor workloads (qualitative) | 2 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 4 of 5 |
| Array-style programming (qualitative) | 2 of 5 | 2 of 5 | 4 of 5 | 5 of 5 | 5 of 5 |
| Half precision and below (qualitative) | 1 of 5 | 3 of 5 | 5 of 5 | 5 of 5 | 3 of 5 |
| Single-thread abstraction (qualitative) | 5 of 5 | 3 of 5 | 4 of 5 | 3 of 5 | 1 of 5 |
| Differentiable kernels (qualitative) | 5 of 5 | 1 of 5 | 5 of 5 | 4 of 5 | 1 of 5 |
| Low-level control (qualitative) | 3 of 5 | 5 of 5 | 2 of 5 | 2 of 5 | 2 of 5 |
| Works with your arrays (qualitative) | 4 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 4 of 5 |
| Deploy outside Python (qualitative) | 4 of 5 | 2 of 5 | 4 of 5 | 4 of 5 | 1 of 5 |
| Extensibility (qualitative) | 3 of 5 | 3 of 5 | 4 of 5 | 4 of 5 | 3 of 5 |
| Wide values | – | – | – | – | – |
| Fused steps | – | – | – | – | – |
| Control flow | – | – | – | – | – |
| Small linear algebra, per lane | – | – | – | – | – |
| Small linear algebra, per team | – | – | – | – | – |
| Contractions | – | – | – | – | – |
| FFT | – | – | – | – | – |
| Scatter | – | – | – | – | – |
| Reductions | – | – | – | – | – |
Every measured axis is the per-sample ensemble workload raptor is built for; dense tensor maths, training and half precision are the qualitative axes, where PyTorch and JAX lead. Outer is better; overlaps are complementary, not a ranking.
NVIDIA Warp gives you near-total control of every kernel, short of raw CUDA. raptor hands that control to the engine on purpose, so compaction and the launch shape are decided at run time; the two are different trade-offs, not a ranking.
How to read this radar
Each of the seven majors is the plain mean of its minor axes (the detailed radar draws every minor), with equal weights and the same rule for every tool; a minor a tool has no reading on is left out of its mean and the major's marker is drawn hollow. Hover or tap a major to see its minors.
- Ensemble speed: Uneven ensembles, Regular ensembles, Small jobs and Adaptive ODEs; measured.
- Footprint and turnaround: Memory, Compile time and Code size; measured.
- Capabilities: Wide values, Fused steps, Control flow, Small linear algebra, per lane, Small linear algebra, per team, Contractions, FFT, Scatter and Reductions; measured.
- Tensors and precision: Tensor workloads, Array-style programming and Half precision and below; qualitative.
- One-sample authoring: Single-thread abstraction and Differentiable kernels; qualitative.
- Low-level control: A single axis, so nothing is averaged; qualitative.
- Reach: Works with your arrays, Deploy outside Python and Extensibility; qualitative.
Each measured axis is stretched over its own best-to-worst range, so ring labels differ per axis (code size: at least 4x). Axes are grouped by theme, so read the axes, not the area.
Italic axes are the author's judgement, not measurements: hollow markers, a linear scale, and no marker where a tool has no reading. A hollow marker on a measured axis means a minor is missing. The hover panel has each axis's full wording.
- Tensor workloads: 5 = dense array maths, batched linear algebra and convolutions are its home ground.
- Array-style programming: 5 = the whole-array expression is the programming model.
- Half precision and below: 5 = FP16, BF16, FP8, FP4 and tensor cores are first-class paths.
- Single-thread abstraction: 5 = you write one sample and nothing else.
- Differentiable kernels: 5 = derivatives are built in for every kernel written in the tool.
- Low-level control: 5 = you write what each thread does and how it is launched.
- Works with your arrays: 5 = zero-copy exchange with other frameworks is the norm.
- Deploy outside Python: 5 = a compiled artefact any program can load.
- Extensibility: 5 = a documented plugin path across many targets.
hawk is what you write; eagle runs it; aether and raptor are the two foundations underneath, and everything ultimately runs on CPU or GPUs — arrows follow the real dependencies, including raptor declared directly by both eagle and hawk.
aether lays out arrays and provides the device-safe vector-algebra vocabulary; eagle launches and captures what runs on top of it; raptor is the dependency-free foundation that defines the manifest and protocol contracts eagle and hawk both build to without depending on each other; hawk authors and compiles the kernels eagle deploys.
Why it matters: keeping the GPU busy#
Per-sample work is a demanding pattern for any parallel machine, and the arithmetic is rarely the hard part. The time tends to go to:
launch overhead: one kernel launch per step, per stage, per sample group;
host round-trips: the CPU checks “are we done yet?” between launches;
dead lanes: in a vectorised batch, finished samples keep occupying the batch until the slowest one ends;
two codebases: a GPU version and a CPU version that drift apart.
RAPTOR addresses each of these by construction:
whole pipelines replay as captured CUDA graphs, removing the per-launch overhead;
termination is decided on the device — each sample carries its own
terminatedflag and stops doing work once it’s set, removing the host round-trip;a finished sample does no further work, and active-set compaction (packing the still-running samples together so finished ones stop occupying GPU lanes) keeps the live samples packed, removing the dead lanes;
one source serves both machines, so there is no second codebase to drift.
The point is to bring this class of problems toward the device’s own peak, which the cards report as a fraction of FP64 peak.
What happens to finished samples#
A batch rarely finishes all at once: most samples stop at their own step, not the batch’s last one. What happens to a sample once it stops depends on how the loop is written. Masked array code keeps computing every sample every step, finished ones included, because the array doesn’t shrink. A hand-written per-thread kernel lets a finished thread exit, but the threads around it are grouped into warps of 32, and a warp only finishes once its slowest thread does — so an idle thread can still hold up its warp. eagle takes a third path: a finished sample leaves the active set, and the next launch covers only the samples still running, so the batch’s live set visibly shrinks as samples finish.
Illustration, not a measurement: a batch of 16 samples that stop at different steps, shown three ways.
The performance card has the real numbers, at real batch sizes, for the regime sketched above and several others — see Going deeper below for the worked-through figures.
What you write, side by side#
The same per-sample task written two ways: Warp’s explicit thread program next to a RAPTOR (hawk) kernel for one sample, with the run-time decisions each leaves to the author and each hands to the engine.
One level down, a kernel compiled elsewhere deploys through
eagle.deploy(kernel) (or eagle.plan.auto, the same function) and loads by its manifest through
eagle.registry.load_manifest. Full, runnable notebook.
What RAPTOR is for#
Many small problems, one per thread. Propagate ten thousand trajectories, integrate a batch of ODEs, step a population of agents. Each sample keeps its own state, takes its own branches and stops when it is done.
One source, two machines. The same kernel compiles for a CUDA GPU or for CPU threads (parallelised with OpenMP, vectorised with SIMD — both standard ways to use multiple CPU cores and lanes at once). No second implementation to keep in sync, and the CPU build is the reference you test the GPU against.
Kernels written in Python, compiled to native code. hawk traces a Python function into a typed intermediate representation (an internal, typed form of the code, not Python itself, that the compiler works from), derives its reverse- and forward-mode derivatives, and emits C++ for the GPU and the CPU.
Launch overhead taken off the table. eagle captures whole pipelines as CUDA graphs and replays them, re-tuning launch geometry (how the work is split across GPU threads) between replays.
Contracts, not glue. raptor’s manifest describes what a compiled kernel computes and how to call it, so a kernel built once can be deployed into any host that can load the contract; today eagle is that loader.
What RAPTOR is not#
Not a deep-learning framework, not an autograd engine for whole programs, not a replacement for cuBLAS or cuDNN (NVIDIA’s own tuned dense-matrix and deep-learning libraries) or any other tuned dense-tensor library. If your problem is one large dense tensor operation, the frameworks below will serve you better, and RAPTOR will happily consume their output.
Where we overlap, and what RAPTOR streamlines#
Several jobs RAPTOR does are also done elsewhere. These are the ones where we think RAPTOR makes the path shorter or clearer:
You want to… |
Common approaches |
What RAPTOR adds |
|---|---|---|
Write a custom GPU kernel from Python |
write a CUDA C string for CuPy’s |
write a typed Python function once; hawk emits it for the GPU and the CPU, with per-sample state and termination declared in the signature |
Differentiate a custom kernel |
write the backward pass yourself (e.g. a |
hawk derives both reverse- and forward-mode derivatives of the kernel itself, as kernels you can run anywhere the primal (the original kernel) runs |
Run a batch where each sample branches and stops early |
vectorise with |
each sample owns its state and a |
Run the same algorithm on CPU and GPU |
keep two code paths or two programming models (Warp is a notable exception) |
one source, two compile targets, same results to within floating point; the CPU build doubles as the reference you test the GPU against |
Remove launch overhead from a pipeline |
use each framework’s own capture API (e.g. |
eagle captures and replays the pipeline, with microsecond-class re-tuning of launch sizes between replays |
Pass arrays between libraries |
DLPack, with the stream ordering left to you |
DLPack with an explicit stream contract, ownership and access flags, and a certified interop matrix |
hawk next to Warp#
Warp and hawk both turn Python functions into CPU and GPU kernels, and both differentiate them. Each offers its own way of working:
Termination lives in the signature. In hawk a sample’s
terminatedflag is part of the kernel’s declared vocabulary: the body writes the per-sample math, and finished samples stop committing results. In a thread-indexed kernel the same logic is explicit (a done flag, an early return, a guarded write-back), which gives full control over it; in hawk it follows from the signature.Authoring by declaration, not by indexing. A hawk kernel declares what each argument is (a per-sample state, a read-only table, a writable output, an accumulator), and hawk derives the indexing, the launch shape and the memory roles from those declarations.
Kernels compose. Kernel kinds (named families of kernels that share a signature vocabulary) give a family of kernels a shared vocabulary; a kernel and its derived reverse- and forward-mode kernels are ordinary kernels you can deploy anywhere the primal (the original, undifferentiated kernel) runs; eagle captures several of them into one replayable graph; and raptor’s manifest lets a compiled kernel be dropped into another program.
Warp is the better choice when you want its built-in geometry, mesh and simulation library, or reverse-mode
gradients of a whole simulation recorded on its tape (a runtime-recorded log of operations that a
reverse-mode pass replays backward). The two work together: arrays pass between them zero-copy in
both directions, with writes seen in the order they were issued — certified by four rows in
raptor’s interoperability matrix
(WP-IN-CUDA-ALIAS, WP-OUT-CUDA-ALIAS, STREAM-WARP-PRODUCER-ORDER, and WP-GRAD-TAPE for a kernel on your tape — the matrix names and defines what each row id
means). A side-by-side
notebook — the same per-sample problem, with early termination, written in both and executed on the GPU, with the
two results checked to agree — is
nvidia_warp_side_by_side.
When another tool is the better choice#
Tool |
Choose it when… |
Use it with RAPTOR by… |
|---|---|---|
numpy |
your data fits on the CPU and vectorised array code is fast enough |
passing arrays in and out zero-copy on the host (DLPack / array interface; a GPU run copies them in); your array code can run between eagle’s steps (guide) |
CuPy |
you want numpy semantics on the GPU, or a hand-written CUDA kernel is fine |
passing CuPy arrays zero-copy; RAPTOR kernels can run on CuPy’s stream (guide) |
PyTorch |
you train deep-learning models or need its ecosystem of models and operators |
a kernel in place of one torch step, with |
JAX |
you want whole-program transformations ( |
a kernel in place of one |
TensorFlow / Keras |
you build and serve models in that ecosystem |
exchanging tensors over DLPack (not among the certified crossings today) |
Numba |
you want to JIT (just-in-time compile — turn a Python function into machine code the first time it runs) ordinary Python loops on the CPU, or write CUDA kernels in Python’s CUDA dialect |
either side can consume the other’s arrays |
Triton |
you are writing high-performance dense GPU operators, especially for machine learning |
composing at the array level |
Warp |
you want differentiable simulation kernels from Python for graphics, robotics or physics, with its rich built-in geometry and simulation library; it already offers one source for CPU and CUDA, reverse-mode kernel autodiff, CUDA-graph capture and DLPack |
passing |
We have not benchmarked against Triton yet. Triton is built for tiled operators over dense tensors, while raptor targets many independent samples that each stop at their own step, the job every tool on our performance cards also does. A measured comparison with Triton is planned and will land shortly.
How they combine#
Arrays cross the boundary through DLPack, zero-copy and in stream order. Every view reports who owns the memory, which library produced it, and whether it may be written.
Supported today: CuPy, PyTorch, NVIDIA Warp and JAX, certified row by row in raptor’s interop matrix (JAX on Python 3.12 and newer, the releases JAX publishes), each with a guide that runs it in both directions. NumPy and CuPy crossings are certified rows too (
NP-HOST-ALIAS,NP-IN-CPU-COPY,CP-IN-ALIAS,CP-OUT-ALIAS); NumPy zero-copy is host-only.Foreseen (same protocol, certification rows to come): TensorFlow/Keras and any other DLPack-capable library.
Each guide ends with its Limits, one line each.
Three ways the tools combine, each with a guide that runs it:
Gradients through your framework. A kernel’s generated derivatives are read by
jax.grad,jacfwdandvmap, by torchbackwardandtorch.func, and bywp.Tape, certified asJX-GRAD-TRANSFORMS,T-GRAD-AUTOGRAD,T-GRAD-FUNCandWP-GRAD-TAPE. Write the physics once, train or optimise with the framework you already use (JAX, PyTorch, Warp).CPU deploy from a hawk-built bundle. hawk can write a bundle with a host (CPU) kernel and its manifest; eagle loads it in a C++ program with no Python and no GPU (embedding a kernel).
Hand your framework’s graph to eagle as a child. A CUDA graph captured by torch or Warp can run as a step inside an eagle graph, so eagle schedules it with the rest of the batch (see the Warp and PyTorch guides above).
See raptor’s interoperability protocols for the full, cited statement of what is certified today versus foreseen, and eagle’s interoperability contract for the stream and lifetime rules.
Going deeper (optional)#
The same task written in five tools side by side, which you do not need in order to follow the page above.
Same task, five ways#
Same task, five ways, measured by the ensemble card: two-body Kepler orbits (mu = 1, float64) from periapsis, a = 1, e uniform in [0, 0.9] (uniform: e = 0.45), random orientation; adaptive RKF7(8) (Fehlberg’s tableau, a mixed absolute/relative max-norm error control and a standard step-size controller). Batch shown: N = 1,000,000.
fact |
|
|---|---|
lines (non-blank, non-comment) |
22 |
what it brings here |
the attempt is per-sample scalar code (22 lines with its launch; the kernel finishes its own samples), one kernel per attempt looped on the device: 1.03 s. |
free from the same source |
a CPU build from the same hawk kernel, with no second implementation to maintain, and the kernel’s own reverse- and forward-mode derivatives. |
@hawk.kernel
def rkf78_attempt(t_final: Param, terminated: Terminated, s: Mutable[Vector[6]],
t: Mutable[Scalar], h: Mutable[Scalar],
n_acc: Mutable[UInt32], n_rej: Mutable[UInt32]):
# One adaptive RKF7(8) attempt of this sample, with its step-size controller.
s0 = s
t0 = t
last = h >= t_final - t0
step = m.where(last, t_final - t0, h) # clip onto the final time
s8, err = rkf78_stages(s0, step, m.sqrt)
ratio = error_ratio(s0, s8, err, abs, m.max)
accept = ratio < 1.0
expo = m.where(accept, EXP_ACCEPT, EXP_REJECT)
h = step * m.min(MAX_SCALE, m.max(MIN_SCALE, SAFETY * ratio ** expo))
s = m.where(accept, m.vec(s8), s0)
t1 = m.where(accept, m.where(last, t_final, t0 + step), t0)
t = t1
n_acc = n_acc + m.uint32(m.where(accept, 1.0, 0.0))
n_rej = n_rej + m.uint32(m.where(accept, 0.0, 1.0))
terminated = t1 >= t_final # the sample finishes itself
st.runner = eagle.until_done(eagle.deploy(rkf78_attempt, scalar_type=SCALAR), max_steps=MAX_ATTEMPTS,
t_final=T_FINAL, terminated=st.terminated,
**st.planes, **options)
fact |
|
|---|---|
lines (non-blank, non-comment) |
25 |
what it brings here |
array code in the NumPy style (25 lines), the control flow as masks over the batch: 74.5 s. |
free from the same source |
no second build and no gradient in this comparison; CuPy itself targets the GPU. |
def cupy_attempt(s, t, h, n_acc, n_rej):
"""One masked RKF7(8) attempt over the whole batch (CuPy arrays)."""
import cupy as cp
running = t < T_FINAL
last = h >= T_FINAL - t
step = cp.where(last, T_FINAL - t, h)
s8, err = rkf78_stages(s, step, cp.sqrt)
ratio = error_ratio(s, s8, err, cp.abs, cp.maximum)
accept = ratio < 1.0
take = running & accept
expo = cp.where(accept, EXP_ACCEPT, EXP_REJECT)
scale = cp.clip(SAFETY * ratio ** expo, MIN_SCALE, MAX_SCALE)
s = [cp.where(take, s8[d], s[d]) for d in range(6)]
t = cp.where(take, cp.where(last, T_FINAL, t + step), t)
h = cp.where(running, step * scale, h)
return s, t, h, n_acc + take, n_rej + (running & ~accept), running
def cupy_run(st):
p = st.planes
s, t, h = [p[k] for k in STATE_NAMES], p["t"], p["h"]
n_acc, n_rej = p["n_acc"], p["n_rej"]
for _ in range(MAX_ATTEMPTS):
s, t, h, n_acc, n_rej, running = cupy_attempt(s, t, h, n_acc, n_rej)
if not bool(running.any()):
break
return s, t, h, n_acc, n_rej
fact |
|
|---|---|
lines (non-blank, non-comment) |
27 |
what it brings here |
|
free from the same source |
gradients through |
def torch_attempt(s, t, h, n_acc, n_rej):
"""One masked RKF7(8) attempt over the whole batch (PyTorch tensors)."""
import torch
running = t < T_FINAL
last = h >= T_FINAL - t
step = torch.where(last, T_FINAL - t, h)
s8, err = rkf78_stages(s, step, torch.sqrt)
ratio = error_ratio(s, s8, err, torch.abs, torch.maximum)
accept = ratio < 1.0
take = running & accept
expo = torch.where(accept, EXP_ACCEPT, EXP_REJECT)
scale = torch.clamp(SAFETY * ratio ** expo, MIN_SCALE, MAX_SCALE)
s = [torch.where(take, s8[d], s[d]) for d in range(6)]
t = torch.where(take, torch.where(last, T_FINAL, t + step), t)
h = torch.where(running, step * scale, h)
return s, t, h, n_acc + take, n_rej + (running & ~accept), running
def torch_run(st):
import torch
with torch.inference_mode():
p = st.planes
s, t, h = [p[k] for k in STATE_NAMES], p["t"], p["h"]
n_acc, n_rej = p["n_acc"], p["n_rej"]
for _ in range(MAX_ATTEMPTS):
s, t, h, n_acc, n_rej, running = torch_attempt(s, t, h, n_acc, n_rej)
if not bool(running.any()):
break
return s, t, h, n_acc, n_rej
fact |
|
|---|---|
lines (non-blank, non-comment) |
25 |
what it brings here |
writes the per-sample loop directly (25 lines) and compiles the whole batch into one executable: 8.81 s. |
free from the same source |
gradients through |
def jax_integrate_fn():
"""jit(vmap(per-sample while loop)) over the initial states."""
import jax
import jax.numpy as jnp
from jax import lax
jax.config.update("jax_enable_x64", True)
def one(s0):
def cond(c):
_, t, _, n_acc, n_rej = c
return (t < T_FINAL) & (n_acc + n_rej < MAX_ATTEMPTS)
def body(c):
s, t, h, n_acc, n_rej = c
last = h >= T_FINAL - t
step = jnp.where(last, T_FINAL - t, h)
s8, err = rkf78_stages(list(s), step, jnp.sqrt)
ratio = error_ratio(list(s), s8, err, jnp.abs, jnp.maximum)
accept = ratio < 1.0
expo = jnp.where(accept, EXP_ACCEPT, EXP_REJECT)
scale = jnp.clip(SAFETY * ratio ** expo, MIN_SCALE, MAX_SCALE)
s = jnp.where(accept, jnp.stack(s8), s)
t = jnp.where(accept, jnp.where(last, T_FINAL, t + step), t)
return s, t, step * scale, n_acc + accept, n_rej + (1 - accept)
init = (s0, jnp.float64(0.0), jnp.float64(H0), jnp.int64(0), jnp.int64(0))
return lax.while_loop(cond, body, init)
return jax.jit(jax.vmap(one))
fact |
|
|---|---|
lines (non-blank, non-comment) |
74 |
what it brings here |
an explicit per-thread loop in a Python-embedded kernel language (74 lines, its own stages): 1.11 s. |
free from the same source |
reverse-mode gradients through |
A = wp.constant(mat_a(*flat_a))
B = wp.constant(vec_s(*RK_B))
BE = wp.constant(vec_s(*RK_BE))
@wp.func
def rhs(s: vec6):
r2 = s[0] * s[0] + s[1] * s[1] + s[2] * s[2]
ir3 = f64(1.0) / (r2 * wp.sqrt(r2))
return vec6(s[3], s[4], s[5], -s[0] * ir3, -s[1] * ir3, -s[2] * ir3)
@wp.kernel
def rkf78(x: wp.array(dtype=f64), y: wp.array(dtype=f64), z: wp.array(dtype=f64),
vx: wp.array(dtype=f64), vy: wp.array(dtype=f64), vz: wp.array(dtype=f64),
t_out: wp.array(dtype=f64), h_out: wp.array(dtype=f64),
acc_out: wp.array(dtype=f64), rej_out: wp.array(dtype=f64),
t_final: f64, rtol: f64, atol: f64, h0: f64, max_attempts: int):
# one thread per sample: its whole adaptive loop to the final time
i = wp.tid()
s = vec6(x[i], y[i], z[i], vx[i], vy[i], vz[i])
t = f64(0.0)
h = h0
n_acc = int(0)
n_rej = int(0)
while t < t_final and n_acc + n_rej < max_attempts:
last = h >= t_final - t
step = h
if last:
step = t_final - t
k = mat_k()
k0 = rhs(s)
for d in range(6):
k[0, d] = k0[d]
for st in range(1, 13):
si = s
for j in range(st):
if A[st, j] != f64(0.0):
for d in range(6):
si[d] = si[d] + step * A[st, j] * k[j, d]
ks = rhs(si)
for d in range(6):
k[st, d] = ks[d]
ratio = f64(0.0)
s8 = s
for d in range(6):
acc = f64(0.0)
err = f64(0.0)
for st in range(13):
acc = acc + B[st] * k[st, d]
err = err + BE[st] * k[st, d]
s8[d] = s[d] + step * acc
sc = atol + rtol * wp.max(wp.abs(s8[d]), wp.abs(s[d]))
ratio = wp.max(ratio, wp.abs(step * err) / sc)
expo = f64(-0.125)
if ratio < f64(1.0):
expo = f64(-1.0 / 9.0)
scale = wp.min(f64(5.0), wp.max(f64(0.2), f64(0.9) * wp.pow(ratio, expo)))
if ratio < f64(1.0):
s = s8
t = t + step
if last:
t = t_final
n_acc += 1
else:
n_rej += 1
h = step * scale
x[i] = s[0]
y[i] = s[1]
z[i] = s[2]
vx[i] = s[3]
vy[i] = s[4]
vz[i] = s[5]
t_out[i] = t
h_out[i] = h
acc_out[i] = f64(n_acc)
rej_out[i] = f64(n_rej)
wp.launch(kernel, dim=n, inputs=[*s.planes.values(), T_FINAL, RTOL, ATOL, H0,
MAX_ATTEMPTS], device="cuda:0")
How the family fits together#
Four libraries, one direction of dependency. aether lays out arrays, eagle launches and replays kernels, hawk writes and compiles them, and raptor holds the shared contracts. Dependencies point one way; raptor never imports the others.
What crosses between them#
Files. hawk compiles a kernel and writes a manifest and a sidecar next to it; eagle reads them and launches the kernel. Neither imports the other for this: both follow raptor’s schema.
Buffers. Arrays cross by DLPack, the standard way for one library to hand another an array without copying it. That is how a kernel runs inside a JAX, PyTorch, Warp or CuPy program, and how your code runs as a step in an eagle batch.
Where each question is answered#
You want to know |
Read |
Repository |
|---|---|---|
How to add a native math function |
hawk |
|
How a graph is recorded, instantiated and replayed |
eagle |
|
How eagle is built, tested and organised |
eagle |
|
What the manifest and sidecar contain |
raptor |
|
What each contract pins, and which test |
raptor |
|
How an interop crossing is certified |
raptor |
To build all four from source, see Building from source. To contribute, start at the repository’s own Contributing page: eagle, hawk, raptor or aether.