Solar Roofline
Overview
AKG Agents' roofline support is provided through an installed solar Python package.
Runtime constraints:
- AKG does not depend on a local
SOLARsource tree path - AKG does not require modifying or patching the
SOLARrepository - AKG maintains the missing bridge pieces internally:
- SOLBench workload wrapper generation
- roofline architecture configs for Ascend / A100 / V100
In other words, AKG now only requires:
python -c "import solar"
to succeed.
Installation
Recommended:
bash download.sh --with_solar
or:
SOLAR_DIR=/path/to/SOLAR bash download.sh --with_solar
SOLAR_REF=<tag|branch|commit> bash download.sh --with_solar
The script will:
- Clone the official Solar repo into
thirdparty/SOLARby default - Optionally override the directory with
SOLAR_DIRand check out a specificSOLAR_REF - Prefer Solar's own
install.sh - Install Solar dependencies, including patched torchview
- Install Solar into the current Python environment in editable mode
- Verify
import solarand the core APIs used by AKG
Runtime behavior
When roofline is enabled during profiling, AKG calls Solar's Python APIs directly:
solar.graph.PyTorchProcessorsolar.einsum.PyTorchToEinsumsolar.analysis.EinsumGraphAnalyzersolar.perf.EinsumGraphPerfModel
Outputs include:
roofline_profile_result.json- profile return fields:
roofline_timeroofline_speeduproofline
Where:
roofline_speedup = roofline_time / gen_time
1.0x means the generated kernel is on the roofline bound; values below 1.0x mean it is still below the theoretical roofline.
Graceful degradation
If Solar is not installed, or Solar analysis fails:
- the main correctness / profiling flow still continues
- roofline degrades to missing data only
- AKG profiling does not fail solely because roofline is unavailable