Skip to content

[Maya] Phase 2B-1: Pipeline Tick Optimization - Batched Writeback Pro… #96

[Maya] Phase 2B-1: Pipeline Tick Optimization - Batched Writeback Pro…

[Maya] Phase 2B-1: Pipeline Tick Optimization - Batched Writeback Pro… #96

name: CPI Comparison
on:
push:
branches: [main]
workflow_dispatch:
jobs:
cpi-comparison:
name: Fast Timing vs Full Pipeline CPI
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Run CPI comparison
run: |
go test -v -run TestCPIComparison -timeout 20m ./benchmarks/ 2>&1 | tee cpi_comparison_output.txt
- name: Post summary
if: always()
run: |
echo "## CPI Comparison: Fast Timing vs Full Pipeline" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f benchmarks/cpi_three_way_results.json ]; then
echo "### Three-Way Comparison (M2 Hardware vs Full Pipeline vs Fast Timing)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
python3 -c "
import json
with open('benchmarks/cpi_three_way_results.json') as f:
data = json.load(f)
print(f\"{'Benchmark':<15} {'M2 CPI':>10} {'Full CPI':>10} {'Fast CPI':>10} {'Full Err%':>12} {'Fast Err%':>12}\")
print('-' * 72)
for r in data:
print(f\"{r['name']:<15} {r['m2_cpi']:>10.3f} {r['full_pipeline_cpi']:>10.3f} {r['fast_timing_cpi']:>10.3f} {r['full_error_pct']:>11.1f}% {r['fast_error_pct']:>11.1f}%\")
" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
if [ -f benchmarks/cpi_comparison_results.json ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Full Benchmark Comparison" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
python3 -c "
import json
with open('benchmarks/cpi_comparison_results.json') as f:
data = json.load(f)
print(f\"{'Benchmark':<30} {'Full CPI':>10} {'Fast CPI':>10} {'Divergence':>12}\")
print('-' * 65)
for r in data:
print(f\"{r['name']:<30} {r['full_pipeline_cpi']:>10.3f} {r['fast_timing_cpi']:>10.3f} {r['divergence_pct']:>11.1f}%\")
total_abs = sum(abs(r['divergence_pct']) for r in data)
avg = total_abs / len(data) if data else 0
print(f\"\nAverage |divergence|: {avg:.1f}%\")
" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: cpi-comparison
path: |
benchmarks/cpi_comparison_results.json
benchmarks/cpi_three_way_results.json
cpi_comparison_output.txt
retention-days: 90