Examples#
Four standalone notebooks, each one task, built from the scripts in
examples/. Unlike
the tutorials, these need hawk (kernel
authoring) and eagle (execution)
installed from PyPI (see Installation), plus pip install "raptor-core[demo]" for
numpy/torch. Every one of them also runs as a plain script from a
checkout — see each notebook’s first cell for the equivalent command line.
Hybrid orbit: analytic physics + a learned correction — one traced kernel performs a whole RK4 step with gravity written by hand and drag learned by a small torch-trained network, compiled once and run on CPU threads or as a replayed CUDA graph. The same compile-once, train-with-
loss.backward()pattern is covered end to end in eagle’s Train through your kernel with PyTorch and hawk’s capstone.Early termination: a batch that finishes at different times — a device-side live count and a conditional graph node let a captured CUDA graph skip replays once every sample in the batch has stopped. For the general trade-off — when thinning a batch like this is worth the overhead — see eagle’s Finished samples: compaction, reorder, and when not to.
Zero-copy interop — the numpy/cupy/torch crossings the certification matrix declares, exercised for real: a pointer-stable host round-trip and (where a CUDA-capable torch build is available) a zero-copy device alias.
Autodiff against torch — hawk differentiates the traced kernel itself (reverse- and forward-mode) rather than executing a separate tape, checked against
torch.autogradand a float64 finite-difference Jacobian.