-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem statement
The geru kernel currently has no dedicated tests under tests/. There is no test_geru.py to validate that all backends correctly implement the rank-1 update
Without geru tests:
- regressions or subtle bugs in any backend may go unnoticed,
- CI cannot guarantee numerical equivalence with the Python reference,
- the README BLAS table cannot mark the
Testcolumn forgeruas complete.
Proposed solution
Add a dedicated pytest module for geru that validates all available backends against the Python reference implementation.
Concretely:
- Introduce
tests/test_geru.pyalongside other kernel tests. - For each backend (Python, PyTorch, Triton, CuTe as available), compare outputs with the Python
gerureference across various matrix sizes and vector shapes. - Cover edge cases such as zero scalars, small matrices, and large magnitude values.
Alternatives considered
Manual or informal testing is not sufficient because it:
- is easy to skip,
- does not integrate with CI,
- fails to provide consistent regression coverage.
Implementation details
- Add
tests/test_geru.pyusing pytest conventions. - Reuse any shared helpers for random input generation and comparison.
- Parameterize tests over matrix dimensions, dtypes, and scalar values.
- Gracefully skip backend-specific tests when backends are unavailable or not yet implemented.
Use case
The geru tests will:
- enforce correctness for
geruacross all backends, - support contributors implementing or optimizing rank-1 update kernels,
- align with the project’s emphasis on numerical equivalence.
Related work
- Existing tests:
tests/test_copy.py,tests/test_swap.py. - BLAS
gerutest suites in other libraries.
Additional context
This issue is part of completing the geru row in the README BLAS table, especially the Test column.
Metadata
Metadata
Assignees
Labels
No labels