Problem & context
Problem
Develop reproducible scientific-computing workflows, then implement and compare sparse matrix-vector multiplication kernels for large matrices without paying the storage cost of a dense representation.
Intended users
Course reviewers and developers studying reproducible numerical software, profiling and performance optimisation.
Role and contributions
Individual coursework, implementation, profiling and performance analysis
Dataset / inputs
The exam benchmark used square sparse matrices in Compressed Sparse Row format with density 0.001. Matrix sizes ranged from 1,000 to 50,000, and each implementation was run five times with the median runtime retained.
Methods & architecture
A Python serial baseline, Numba JIT serial kernel and Numba parallel kernel were compared with SciPy CSR multiplication. Correctness was checked against SciPy. The serial implementation was profiled line by line to locate the dominant multiply-accumulate loop.
Implementation
- Structure a reusable Python package with environments, configuration and tests
- Implement and optimise a k-nearest-neighbours classifier across practical sessions
- Profile numerical bottlenecks with line_profiler
- Implement serial, JIT-compiled and parallel CSR matrix-vector multiplication
- Validate all three custom matrix-vector kernels against SciPy
- Benchmark runtime and compare CSR memory requirements with dense storage
Verified results
Metrics below are reported under the project's documented evaluation conditions.
Limitations & next steps
The reported timings come from the repository's documented benchmark environment and are workload- and hardware-dependent. The maximum 557.6x speedup was measured for the 10,000-row case; the parallel speedup at 50,000 rows was approximately 302.3x. The multi-GPU exercise was described but not executed on the Ulysses cluster.
Extend the benchmark across additional sparsity patterns and hardware, record environment metadata, and compare scaling across thread counts.
Attribution & licence
MIT License. Copyright (c) 2026 Wastalas.