Write your own kernel optimiser
Web page · https://blog.csongor.co.uk/cachet-grids-and-tiles
First seen by Oriel on .
AI summary
The post introduces Cachet, a language that separates mathematical computations from schedules and checks whether optimization rewrites preserve their meaning, demonstrated through CPU- and GPU-oriented matrix multiplication.
- Cachet contractions express each output as an equation, while schedules apply compile-time transformations to the computation.
- On one core, swapping the naive loop order raises performance from 1.17 to 33 GFLOP/s on 1024 × 1024 f32 matrices, reaching 30% of OpenBLAS.
- Schedules can zero outputs, split reduction loops into chunks, and reorder work while preserving each output’s floating-point accumulation order.
- Blocking reuses input values across neighboring outputs; the example reduces algorithmic input loads from 256 to 64 for a 4 × 4 output block.
- The author reports that Cachet checks programs for NVIDIA’s H100 but cannot yet build them for it; the article’s measured examples use an M4 Max.
#cachet #compiler optimization #matrix multiplication #gpu computing
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Hacker News: 41, latest observation ; +37 over observed period since
Comments
Comment count reported by the source.
- Hacker News: 3, latest observation ; +3 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Hacker News | 50444891 | https://blog.csongor.co.uk/cachet-grids-and-tiles/ Read discussion |