SIR and Backends
SIR, short for Silicon IR, is the graph-oriented lowering path used for Vex's data-parallel execution model.
What SIR Is For
SIR is the part of the architecture that turns array-, tensor-, and graph-friendly computation into backend-specific execution plans.
Typical features routed through or associated with this layer include:
- tensor and mask lowering
- fused arithmetic graphs
- reductions and SIMD-oriented ops
- backend-specific code generation
Main Idea
Vex source
-> HIR
-> SIR graph
-> optimization / fusion / lowering
-> backend codegenCode Generation and Execution
Each route needs several independently implemented pieces:
- HIR lowering for the operation, type and shape.
- A legal SIR graph and backend emitter.
- A compatible kernel representation, such as MSL, PTX or SPIR-V.
- A runtime executor and compiler bridge using the same buffer/entry contract.
- A compatible device, installed provider and numerical validation.
An emitter producing text proves only one step. For example, ROCm HIP source is not a loadable HSACO code object; a WebGPU runtime executor does not by itself make every legacy compiler-generated GPU call ABI compatible. The backend reference separates these routes.
Routing and Fallbacks
The architecture includes runtime/backend selection and fallback logic. That means a graph may:
- stay on SIMD/CPU
- route to a specific backend
- fall back depending on capability, shape, or runtime constraints
This is part of why backend maturity and runtime availability both matter.