Kernel Selection for IR Graphs #
Adapter from TorchLean's op-tagged IR to backend capsules.
This is intentionally a planning layer, not an evaluator. The graph remains the semantic object; the planner selects which backend contract should implement each node or node family.
Backend operation tag for an IR op, or none for a node that needs no backend kernel.
These tags are the same vocabulary used by backend capsules and runtime reports.
If an op maps to a tag that has no capsule for the selected profile, planning fails at the backend
boundary instead of silently using a broader bucket. Pointwise operators map only to a backend
operation with the same meaning: negation, true division and the tanh GELU. planNode? rejects
the others.
Instances For
Backend choice for one concrete IR node.
- nodeId : ℕ
- kind : IR.OpKind
- op : BackendOp
- capsule : KernelCapsule
Instances For
Instances For
Selected kernel capsules with the source IR node identity preserved.
- kernels : Array PlannedNodeKernel
Instances For
Node ids covered by backend kernels, in graph order.
Instances For
Selected capsule names, in graph order.
Instances For
Plan a single IR node when it corresponds to runtime work.
available is the capsule registry already restricted by Availability.filterCapsules, so a graph
planner filters once rather than once per node.
Instances For
Plan every runtime-relevant node in graph order.
Instances For
Check graph well-formedness, then plan every runtime-relevant node.