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#

  1. 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.

  2. 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.

  3. 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.

  4. 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.

UnevenensemblesRegularensemblesSmall jobsAdaptiveODEsMemoryCompiletimeCode sizeTensorsArray styleHalfprecisionSingle-threadDerivativesControlYour arraysDeployExtensibilityWide valuesFused stepsControlflowSmall linearalgebra, per laneSmall linearalgebra, per teamContractionsFFTScatterReductions
  1. 1 Uneven ensembles faster is better
  2. 2 Regular ensembles faster is better
  3. 3 Small jobs faster is better
  4. 4 Adaptive ODEs faster is better
  5. 5 Memory smaller is better
  6. 6 Compile time lower is better
  7. 7 Code size smaller is better
  8. 8 Tensor workloads (qualitative)
  9. 9 Array-style programming (qualitative)
  10. 10 Half precision and below (qualitative)
  11. 11 Single-thread abstraction (qualitative)
  12. 12 Differentiable kernels (qualitative)
  13. 13 Low-level control (qualitative)
  14. 14 Works with your arrays (qualitative)
  15. 15 Deploy outside Python (qualitative)
  16. 16 Extensibility (qualitative)
  17. 17 Wide values faster is better
  18. 18 Fused steps faster is better
  19. 19 Control flow faster is better
  20. 20 Small linear algebra, per lane faster is better
  21. 21 Small linear algebra, per team faster is better
  22. 22 Contractions faster is better
  23. 23 FFT faster is better
  24. 24 Scatter faster is better
  25. 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
AxisraptorNVIDIA WarpJAXPyTorchCuPy
Uneven ensembles48.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 ensembles40.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 jobs103 µ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 ODEs43.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)
Memory102 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 time2.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 size21 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 53 of 55 of 55 of 54 of 5
Array-style programming (qualitative)2 of 52 of 54 of 55 of 55 of 5
Half precision and below (qualitative)1 of 53 of 55 of 55 of 53 of 5
Single-thread abstraction (qualitative)5 of 53 of 54 of 53 of 52 of 5
Differentiable kernels (qualitative)5 of 54 of 55 of 54 of 51 of 5
Low-level control (qualitative)3 of 55 of 53 of 52 of 53 of 5
Works with your arrays (qualitative)4 of 54 of 54 of 54 of 55 of 5
Deploy outside Python (qualitative)4 of 53 of 54 of 54 of 51 of 5
Extensibility (qualitative)3 of 52 of 54 of 54 of 52 of 5
Wide values979 µs (2.5× the best)––378 µs (1.0× the best)–
Fused steps616 µs (1.0× the best)21.5 ms (34× the best)–1.13 ms (1.8× the best)–
Control flow10.6 ms (1.1× the best)9.43 ms (1.0× the best)–––
Small linear algebra, per lane1.66 ms (1.0× the best)–––6.44 ms (3.8× the best)
Small linear algebra, per team65.5 ms (10× the best)––5.97 ms (1.0× the best)19.8 ms (3.3× the best)
Contractions28.7 µs (1.0× the best)––––
FFT1.08 ms (1.0× the best)–––1.14 ms (1.0× the best)
Scatter393 µs (1.1× the best)–––333 µs (1.0× the best)
Reductions185 µs (2.6× the best)–––71.3 µ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.

Every number, in the full tables.

UnevenensemblesRegularensemblesSmall jobsAdaptiveODEsMemoryCompiletimeCode sizeTensorsArray styleHalfprecisionSingle-threadDerivativesControlYour arraysDeployExtensibilityWide valuesFused stepsControlflowSmall linearalgebra, per laneSmall linearalgebra, per teamContractionsFFTScatterReductions
  1. 1 Uneven ensembles faster is better
  2. 2 Regular ensembles faster is better
  3. 3 Small jobs faster is better
  4. 4 Adaptive ODEs faster is better
  5. 5 Memory smaller is better
  6. 6 Compile time lower is better
  7. 7 Code size smaller is better
  8. 8 Tensor workloads (qualitative)
  9. 9 Array-style programming (qualitative)
  10. 10 Half precision and below (qualitative)
  11. 11 Single-thread abstraction (qualitative)
  12. 12 Differentiable kernels (qualitative)
  13. 13 Low-level control (qualitative)
  14. 14 Works with your arrays (qualitative)
  15. 15 Deploy outside Python (qualitative)
  16. 16 Extensibility (qualitative)
  17. 17 Wide values faster is better
  18. 18 Fused steps faster is better
  19. 19 Control flow faster is better
  20. 20 Small linear algebra, per lane faster is better
  21. 21 Small linear algebra, per team faster is better
  22. 22 Contractions faster is better
  23. 23 FFT faster is better
  24. 24 Scatter faster is better
  25. 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
AxisraptorNumbaJAXPyTorchNumPy
Uneven ensembles2.49 s (1.0× the best)19.6 s (7.8× the best)60.5 s (24× the best)––
Regular ensembles2.06 s (1.0× the best)17.8 s (8.6× the best)28.8 s (13× the best)––
Small jobs167 µ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 ODEs3.76 s (1.0× the best)19.9 s (5.3× the best)60.5 s (16× the best)––
Memory–––––
Compile time565 ms (7.8× the best)449 ms (6.2× the best)71.5 ms (1.0× the best)––
Code size22 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 53 of 55 of 55 of 54 of 5
Array-style programming (qualitative)2 of 52 of 54 of 55 of 55 of 5
Half precision and below (qualitative)1 of 53 of 55 of 55 of 53 of 5
Single-thread abstraction (qualitative)5 of 53 of 54 of 53 of 51 of 5
Differentiable kernels (qualitative)5 of 51 of 55 of 54 of 51 of 5
Low-level control (qualitative)3 of 55 of 52 of 52 of 52 of 5
Works with your arrays (qualitative)4 of 53 of 54 of 54 of 54 of 5
Deploy outside Python (qualitative)4 of 52 of 54 of 54 of 51 of 5
Extensibility (qualitative)3 of 53 of 54 of 54 of 53 of 5
Wide values90.5 ms (1.9× the best)––47.5 ms (1.0× the best)105 ms (2.2× the best)
Fused steps259 ms (2.5× the best)––101 ms (1.0× the best)–
Control flow694 ms (1.0× the best)––––
Small linear algebra, per lane41.2 ms (1.0× the best)––299 ms (7.2× the best)–
Small linear algebra, per team–––––
Contractions78.8 µs (1.0× the best)––––
FFT–––––
Scatter9.80 ms (2.2× the best)–––4.36 ms (1.0× the best)
Reductions3.63 ms (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.

Every number, in the full tables.

A stack diagram. At the top, "you write" a hawk kernel in Python. Below it, eagle runs the kernel with launches, graphs and compaction, on CPU or GPU, and hawk kernels run through eagle. At the base are the two foundations, aether (a header-only C++23 numerics core that eagle builds on) and raptor (the dependency-free contracts foundation that both eagle and hawk declare). At the very bottom, "it runs on" CPU and GPUs. A stack diagram. At the top, "you write" a hawk kernel in Python. Below it, eagle runs the kernel with launches, graphs and compaction, on CPU or GPU, and hawk kernels run through eagle. At the base are the two foundations, aether (a header-only C++23 numerics core that eagle builds on) and raptor (the dependency-free contracts foundation that both eagle and hawk declare). At the very bottom, "it runs on" CPU and GPUs.

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 terminated flag 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.

Three rows showing the same illustrative batch of 16 samples at four points in time. Masked array code keeps all 16 cells drawn every step, with finished samples shown faded and still occupying the batch. Per-thread kernel keeps all 16 cells drawn too, with finished samples shown as empty because the warp still waits for its slowest lane. Eagle with compaction shows fewer and fewer cells as samples finish, from 16 active at the start down to 4 active by the last snapshot. Three rows showing the same illustrative batch of 16 samples at four points in time. Masked array code keeps all 16 cells drawn every step, with finished samples shown faded and still occupying the batch. Per-thread kernel keeps all 16 cells drawn too, with finished samples shown as empty because the warp still waits for its slowest lane. Eagle with compaction shows fewer and fewer cells as samples finish, from 16 active at the start down to 4 active by the last snapshot.

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#

Two side-by-side columns for the same batch-of-trajectories task. Left, Warp: you write the thread program, a tiny wp.kernel with a per-thread while-loop and its own exit test, launched once over all threads. Right, RAPTOR: you write one step of one sample, a tiny hawk.kernel that writes the per-sample math and sets its own terminated flag, with eagle driving the repeated launches. Below each code sketch, a list of six run-time decisions -- the per-sample loop and exit, launch timing, compaction and reorder, graph capture, running on CPU and GPU, and derivatives -- each marked 'you' where the author writes it explicitly or 'engine' where eagle decides it at run time. Two side-by-side columns for the same batch-of-trajectories task. Left, Warp: you write the thread program, a tiny wp.kernel with a per-thread while-loop and its own exit test, launched once over all threads. Right, RAPTOR: you write one step of one sample, a tiny hawk.kernel that writes the per-sample math and sets its own terminated flag, with eagle driving the repeated launches. Below each code sketch, a list of six run-time decisions -- the per-sample loop and exit, launch timing, compaction and reorder, graph capture, running on CPU and GPU, and derivatives -- each marked 'you' where the author writes it explicitly or 'engine' where eagle decides it at run time.

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 RawKernel, a Numba CUDA kernel, a Triton kernel (GPU-focused), or an NVIDIA Warp kernel (one source for CPU and CUDA)

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 torch.autograd.Function or jax.custom_vjp), or use NVIDIA Warp, whose emphasis is reverse mode on its tape

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 vmap/masks, so finished samples keep occupying the batch

each sample owns its state and a terminated flag; finished samples stop working

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. torch.cuda.graph, Warp’s ScopedCapture) around the calls

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 terminated flag 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 backward, torch.compile and CUDA graphs unchanged, and your torch model as a step inside an eagle batch (guide)

JAX

you want whole-program transformations (jit, grad, vmap) over array code, compiled through XLA (Google’s whole-program compiler)

a kernel in place of one jax.numpy step, inside jit, grad, vmap and lax.scan (row JX-GRAD-TRANSFORMS; the CPU leg is certified, the GPU leg awaits a run on a GPU build of JAX), on XLA’s stream; your jitted model can run between eagle launches (guide)

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 wp.arrays zero-copy both ways, a kernel on your wp.Tape and inside your CUDA graph, and your Warp kernels as steps inside an eagle batch (guide); see hawk next to Warp for what each makes easier

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, jacfwd and vmap, by torch backward and torch.func, and by wp.Tape, certified as JX-GRAD-TRANSFORMS, T-GRAD-AUTOGRAD, T-GRAD-FUNC and WP-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 torch.autograd, and the tensors run on CPU too (untested on this card).

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 jax.grad, and the same code runs on a CPU backend (untested on this card).

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 wp.Tape, and a CPU device (untested on this card).

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

Add a native function

hawk

How a graph is recorded, instantiated and replayed

Capture and replay

eagle

How eagle is built, tested and organised

Developer guide

eagle

What the manifest and sidecar contain

Plugin schema

raptor

What each contract pins, and which test

Concepts

raptor

How an interop crossing is certified

Contributing a certification row

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.