Compiler Stack
This section describes the full compilation pipeline that transforms PyTorch models into programs executable on the Spyre hardware.
The pipeline consists of two compilers:
Inductor front-end — an open-source PyTorch Inductor extension implemented as part of Torch-Spyre. It maps FX graphs to Spyre operations and generates SuperDSC specifications.
DeepTools back-end — a proprietary compiler that translates SuperDSC into optimized Spyre program binaries.
The documentation is organized in four parts:
Overview — the big-picture architecture of the compilation pipeline.
Compilers — deep dives on the Inductor front-end and the DeepTools back-end.
Operations — how to add new operations to the Spyre backend.
Optimization passes — the pre-scheduling transformations applied by the front-end. These are presented in pipeline order: working set reduction first (the design concept), then coarse-tiling (the IR rewrite that implements it), then work-division across cores, then scratchpad placement.
For the project workflow around enabling and triaging new ops (issues, test coverage, bug classification), see Op enablement overview.
Optimization passes
- Working Set Reduction - Design Document
- Coarse-Tiling Loop IR for the Spyre Backend
- Span-Overflow Hint Analysis
- Background
- High-Level Contract
- Concrete Examples
- Entry Point
- Scope
- Pointwise Flow
- Reduction Flow
- BMM-Specific Symbol Mapping
- Span Calculation
- Candidate Collection
- Split Candidates and Cost Search
- Post-Tile Validation
- Multi-Level Plans
- Adapter and Coarse Tiling
- Configuration
- Failure Policy
- Known Limitations
- Validation
- Key Files
- Work Division Planning
- What work division does
- Three-pass planner overview
- Key concepts
- Pass 1 — Span Reduction (
span_reduction) - Pass 2 — Cost-Model Matmul Division (
cost_model_matmul_division) - Pass 3 — Work Distribution (
work_distribution) - Worked example: large matmul on 32 cores
- Interaction with SDSC and scratchpad planning
- User Work-Division Hints
- Limitations and Future Work
- See Also
- Scratchpad (LX) optimization