Tiling Work Update: `experiment/tiling-knobs` #43
This should not live in the bench folder. It's better for the results to be condensed and written in the paper if we are to talk about it.
The fix looks right. I'd just put it in its own commit since it changes the generated matrices and is separate from the tiling work.
The tiled function is called from RVSP_KERNEL_NAME, but bench goes through rvsp_spgemm_compute → numeric_for() → rvsp_spgemm_<name>_f32_numeric, which is still the untiled path.
So the benchmark can run successfully and have no tiling arm. The tiled implementation needs to be hooked up as the numeric function for its own algorithm.
Also, the mallocs are inside the numeric pass here. We moved those out of the timed region before, so this puts allocation back into what we're measuring.
This means the 19 SuiteSparse matrices aren't being benchmarked anymore.
If this is just experimental, it probably makes sense to keep it self-contained in its own experiments/ folder with its own benchmark and logic. If we want to evaluate it through the existing benchmark setup, though, it needs to be integrated with the current code path. I can take care of that integration if we decide to go that route.
ayokunle321
HamzaMateen
Summary
Tiling is implemented and results are numerically correct, but currently slower than untiled due to cursor overhead. Fixing requires restructuring the numeric pass' inner loop to make cursor work O(nnz(B)) instead of *O(strips rows(B))*.
I tested on Qemu for correctness, and the cache locality effects were tested on native x86_64 machine build.
Results
Cache Locality (Nonzeros-per-row pinned at 8)
| Columns | Accumulator | nnz(C) | GOP/s |
|---------|-------------|--------|-------|
| 4K | 52 KB | 263K | 0.119 |
| 16K | 208 KB | 1M | 0.115 |
| 65K | 832 KB | 4.2M | 0.082 |
| 262K | 3.3 MB | 16.8M | 0.047 |
| 1M | 13 MB | 67.1M | 0.037 |
3.27x loss top to bottom and bending knee is 208-832 KB.
Tiling Implementation
Performance: Slower at Every Tile Size
Interleaved repeats at N=65,536:
At tile=131,072 (single strip, identical arithmetic), ~27% slower because the cursor visits every row of B on every strip instead of just nnz(B):
Next Steps
1. Re-measure large-tile-only on F3 board
2. Decide on O(nnz(B)) restructure based on results
3. Symbolic-pass tiling still untouched (~2/3 remaining scattered traffic)
Side Findings