Summary
When compiling, emit a machine-readable description of the kernel interface (name, parameters, shared memory, element types/sizes) next to or embedded with the PTX.
Motivation
Hosts currently re-parse Forth headers or hard-code layouts. That is brittle for:
- Python launch APIs
- Multi-kernel projects
- Tooling that binds tensors by name
Metadata should be a compile artifact, not a second parser of source.
Proposed artifact
kernel.ptx + kernel.json (or a single archive / PTX comment section):
{
"kernel": "attention",
"arch": "sm_80",
"params": [
{"name": "Q", "kind": "buffer", "element": "f32", "count": 32768},
{"name": "SEQ_LEN", "kind": "scalar", "type": "i64"}
],
"shared": [
{"name": "SCORES", "element": "f64", "count": 1024}
]
}
CLI
warpforthc attention.forth -o attention.ptx --emit-metadata attention.json
# or default: write attention.json next to -o
Acceptance criteria
Related
Summary
When compiling, emit a machine-readable description of the kernel interface (name, parameters, shared memory, element types/sizes) next to or embedded with the PTX.
Motivation
Hosts currently re-parse Forth headers or hard-code layouts. That is brittle for:
Metadata should be a compile artifact, not a second parser of source.
Proposed artifact
kernel.ptx+kernel.json(or a single archive / PTX comment section):{ "kernel": "attention", "arch": "sm_80", "params": [ {"name": "Q", "kind": "buffer", "element": "f32", "count": 32768}, {"name": "SEQ_LEN", "kind": "scalar", "type": "i64"} ], "shared": [ {"name": "SCORES", "element": "f64", "count": 1024} ] }CLI
warpforthc attention.forth -o attention.ptx --emit-metadata attention.json # or default: write attention.json next to -oAcceptance criteria
.forthdocs/Related