Plugin schema (v1 and v2)#
A plugin, in one picture#
The code generator — a separate DSL/JIT-compiler library that eagle’s launch engine serves — compiles a kernel and writes it to disk as a small set of files, a producer step (see the glossary for this page’s words). Later, at deploy time, eagle reads those files back and turns them into something you can call — a loader step. Neither side needs the other’s source code; they agree only on the files’ shape. Concretely, for one compiled kernel:
build_dir/
escape.ptx <- the compiled GPU code (producer output)
escape.json <- the "sidecar": how to call escape.ptx (producer output)
PTX is an intermediate, architecture-portable GPU assembly format — the
GPU driver JIT-compiles it to real machine code at load time, so one
.ptx file runs on any supported GPU generation without being rebuilt for
each one.
and the sidecar itself, annotated:
{
"format": "ptx",
"schema_version": 1,
"pattern": "pure",
"aether_abi": "aether-abi/1",
"kernel": "raptor_kernel",
"per_sample": ["r_max"],
"arg_spec": [["nsamples", "N"], ["per_sample", "r_max"], ["mutable", "fired"]]
}
Reading it top to bottom: this artifact is PTX-format (The arg_spec role vocabulary
below covers format’s siblings), speaks plugin schema version 1
(this page’s own versioning — see The aether_abi tag is separate for how that differs
from aether_abi), is a pure-shaped kernel (as opposed to vector — the
same two kernel shapes the code generator’s docs describe), was compiled against binary
layout aether-abi/1, exposes the entry point raptor_kernel (the one
name every artifact exports, see kernel below), and
arg_spec is the exact, ordered list of arguments a loader must bind to
call it — each a [role, name] pair. A role (nsamples,
per_sample, mutable, and 6 others) says what kind of argument a
name is; The arg_spec role vocabulary below is the complete list.
When you have several kernels to deploy together, one manifest
(manifest.json) lists them all, each with its own artifact + sidecar
pair — see the deployment manifest below for its
exact shape.
Words used on this page#
Producer, loader, sink, consolidation and the aether_abi tag are
explained in the family glossary, along with the
other terms the raptor pages share.
Now the exhaustive shapes — for daily reference once the picture above makes sense.
Overview#
eagle owns the plugin protocol: the on-disk contract between the producer and every loader, as sketched above. A deployment unit is:
one manifest (
manifest.json) — an ordered list of plugin artifacts;one artifact per plugin (
<id>.ptx/.cubin/.fatbin, or.sofor a host plugin) — the compiled kernel;one sidecar (
<id>.json) per artifact — its launch signature.
This page freezes both JSON shapes as schema v1. The sidecar schema also accepts the v2 and v3 documents (execution axis, aether-abi/2) that hawk writes. The normative machine-readable
definitions are the two JSON Schema files (draft 2020-12) shipped alongside this
page:
The schema version is single-sourced from raptor.schema.manifest.SCHEMA_VERSION
(Python; re-exported as eagle.roles.SCHEMA_VERSION) ≡
plugin/roles.h::kPluginSchemaVersion (C++); its current frozen value is
1.
The details, page by page#
Each page below holds one part of the schema.
The deployment manifest — the manifest, the file that lists a deployment’s plugins.
The sidecar — the per-kernel file that says how to call it, with its variant additions.
The graph_block descriptor — the descriptor for graph blocks.
C++ reference-consumer scope boundary — what the C++ reference consumer covers, and the float32 capability it defers.
Compatibility policy — the compatibility policy, and why the
aether_abitag is versioned separately.The v2 execution axis (aether-abi/2) and eagle’s Python plan/exec API — the v2 execution axis, driving a v2 body from Python, and running across MPI ranks.
Reserved capability fields — reserved capability fields and the JSON Schema files.
The arg_spec role vocabulary#
arg_spec is an ordered list of two-element [role, name] arrays — role
first. role is one of these 12 canonical arg-spec roles (schema v1).
This set is the single source of truth, enumerated identically in
plugin/roles.h::kPluginArgRoles (C++) and eagle.roles.ROLES (Python),
and pinned by the cross-check test python/tests/test_roles_vocab.py. The
first 9 were present at the schema-v1 freeze; wide_in, wide_out and
accum_out were added later, additively — admitting a role is not a wire
shape change, so none of the three needed a schema_version bump.
Role |
Meaning |
|---|---|
|
The plugin’s output sink (the vector |
|
A named vector input (from |
|
A matrix input to a pure or vector kernel (see the note below;
vector twin — a returning kind’s |
|
A named per-sample scalar input (from |
|
A read-only lookup buffer, bound by value as a flat handle (from
|
|
A writable per-sample state slot — the pure output (from |
|
The per-sample terminated/active mask. |
|
A uniform scalar parameter (from |
|
The sample count. |
|
A named “wide” buffer input, bound by value as a flat handle — the
same wire shape as |
|
A named wide-buffer output: the VJP scatter-gradient counterpart to
|
|
The cross-sample accumulate plane a |
The per-kind subsets (vector = 6, pure = 8 roles) union to exactly this set of 12.
Note
mat_in is a valid schema-v1 role recognized by every loader; the
reference C++ host inject() (plugin/host_registry.h, CPU) packs it
identically to vec_in (a matrix GRef is a width-R*C vector GRef, so
it rides the same GRefMirror), so a matrix pure or vector kernel
host-round-trips today (test_matrix_pure_to_host_matches_direct
/ test_matrix_vector_to_host_matches_direct). The device
PluginRegistry::inject() (plugin/plugin_registry/registry.h, CUDA)
packs it the same way via its own bind_matrix — see the
mattrace fixture in eagle’s C++ embedding example
(eagle’s own userguide/examples page) for a device-side,
driver-loaded matrix input exercised end to end.