ComputeGraphExecutor
Executes an optimized ComputeGraph by walking nodes in topological order and dispatching each operation through TensorOps.
For standard operations (matmul, add, relu, etc.), the executor delegates to the corresponding TensorOps method. For fused operations produced by optimization passes (e.g., fused_rms_norm, fused_swiglu_ffn, fused_qkv_proj), the executor looks up a registered FusedOpHandler or falls back to decomposing the fused op into its constituent operations.
Usage:
val executor = ComputeGraphExecutor(optimizedGraph, cpuOps)
val outputs = executor.execute(mapOf("input" to inputTensor))Content copied to clipboard
Parameters
graph
The optimized compute graph to execute
ops
The tensor operations backend (CPU, Metal, CUDA)