Summary
Extend gpu_test/ beyond arithmetic/stack micro-ops with end-to-end numerical tests for real algorithms: naive matmul, shared-memory tiled matmul (when applicable), and scaled-dot-product attention.
Motivation
LIT covers translation and conversion thoroughly. gpu_test/test_kernels.py mostly checks +, DUP, simple stores, etc. Regressions in address spaces, barriers, float paths, or multi-param kernels can slip through until the GPT-2 demo is run by hand.
Algorithm tests also give a baseline for performance work (#10, #11, #12, stack flattening).
Proposed cases
| Test |
Validates |
| Naive matmul (small MNK) |
multi-buffer params, GLOBAL-ID, loops |
| Tiled matmul + shared + BARRIER |
S@/S!, synchronization |
| Attention (tiny seq/head) |
f32 global, f64 shared, softmax, causal mask |
| Scalar + array mix |
header + runner path |
| Reduced-width roundtrip |
F32@/F32! correctness |
Use numpy/torch reference implementations; assert allclose with documented tolerances.
Acceptance criteria
Related
Summary
Extend
gpu_test/beyond arithmetic/stack micro-ops with end-to-end numerical tests for real algorithms: naive matmul, shared-memory tiled matmul (when applicable), and scaled-dot-product attention.Motivation
LIT covers translation and conversion thoroughly.
gpu_test/test_kernels.pymostly checks+,DUP, simple stores, etc. Regressions in address spaces, barriers, float paths, or multi-param kernels can slip through until the GPT-2 demo is run by hand.Algorithm tests also give a baseline for performance work (#10, #11, #12, stack flattening).
Proposed cases
Use numpy/torch reference implementations; assert allclose with documented tolerances.
Acceptance criteria
@pytest.mark.gpuand skip cleanly without API key / GPURelated