Use eagle with other frameworks#
eagle fits into the program you already have, in both directions. One page per framework shows each.
Your framework calls eagle |
eagle runs your framework |
|
|---|---|---|
In one line |
a hawk kernel replaces one step of your program |
your model or kernels run as a node, once per step over a whole batch |
You keep |
your loop, optimizer and transformations |
your model, its weights and its gradients |
Where to look |
the first sections of each page below |
the inside-an-eagle-batch section of each page below, and the three tiers |
Pass a NumPy array, a CuPy array, a PyTorch tensor, a JAX array or a Warp array; the buffer crosses through DLPack, without a copy where the device allows, and the result comes back in the framework you came from.
PyTorch: a kernel inside
loss.backward(),torch.compile,torch.funcand CUDA graphs; yournn.Moduleas a node in a stepping loop.JAX: a kernel inside
jit,grad,vmapandlax.scan; a jitted step as a node. Then three short tutorials: a training step, batches and Jacobians, a stepping loop.CuPy and NumPy: arrays in, arrays out; your array code as a node between kernels.
NVIDIA Warp:
wp.arrayin, a launch next to your Warp kernels; your launches or captured graph as a node.
Colab or Kaggle: run this first cell (it installs the packages and downloads the helper files this notebook uses). Elsewhere it only checks the imports.
What’s certified today#
raptor’s interop certification matrix is the family’s single source of truth for which (framework, kind) combinations are exercised end to end — see the interoperability protocols reference. The table below is generated from that matrix, not typed by hand, so it cannot drift from it.
from raptor.conformance import interop as _interop
_KINDS = {"ALIAS": "zero-copy", "COPY": "copies once", "STREAM": "stream-ordered"}
rows = sorted(
(d.framework, _KINDS[d.kind])
for d in _interop.ROWS.values()
if d.framework in _interop.CERTIFIED and d.kind in _KINDS
)
print(f"{'framework':<10} {'crossing'}")
for framework, kind in rows:
print(f"{framework:<10} {kind}")
framework crossing
cupy stream-ordered
cupy zero-copy
cupy zero-copy
jax copies once
jax stream-ordered
jax stream-ordered
jax stream-ordered
jax stream-ordered
jax zero-copy
jax zero-copy
jax zero-copy
jax zero-copy
numpy copies once
numpy zero-copy
torch copies once
torch copies once
torch stream-ordered
torch stream-ordered
torch stream-ordered
torch stream-ordered
torch stream-ordered
torch zero-copy
torch zero-copy
torch zero-copy
torch zero-copy
torch zero-copy
torch zero-copy
warp stream-ordered
warp zero-copy
warp zero-copy
Gradients, certified#
The same matrix certifies derivatives: each framework’s own machinery is run through an eagle kernel and compared with the same law written in that framework alone.
JAX:
grad,jit(grad),vmap(grad),jacfwdandjacrev(tutorials 12 and 13).PyTorch:
backwardwithgradcheck(forward AD included), andtorch.func.grad,jvpandvmap(tutorial 3).NVIDIA Warp:
wp.Tape, against finite differences (tutorial 16).Through your own code in an eagle graph: your node’s vjp joins the reverse (tutorial 10).
NumPy and CuPy have no autodiff; their rows certify the hand-over. Write the vjp yourself and pass it as
vjps=.
The rows, read from the matrix:
grad_rows = sorted((d.framework or "-", row) for row, d in _interop.ROWS.items() if "-GRAD-" in row or "VJP" in row)
for framework, row in grad_rows:
print(f"{framework:<8} {row}")
jax JX-GRAD-TRANSFORMS
torch INJ-RUN-VJP
torch INJ-VJP-CHAIN
torch T-GRAD-AUTOGRAD
torch T-GRAD-FUNC
warp WP-GRAD-TAPE
Roadmap
TensorFlow/Keras, and any other DLPack-capable framework are
foreseen — eagle.interop.detect already recognizes a bare DLPack
producer — but are not yet certified by raptor’s interop matrix. Treat only
the frameworks in the table above as supported until a row for a new one
lands there.