forked from kosipov/pp_122-mko-lab2
971 B
971 B
Independent Practice
Assignment (≈60 minutes)
- Implement SAXPY in CuPy for
Nranging from10³to10⁸. Measure kernel execution time and host↔device transfer time separately. Find the smallestNat which the GPU is faster. - Perform one stencil update in three ways: with CuPy slicing, with a custom kernel (
numba-cudaor CuPy’sRawKernel), and with PyTorch tensors. Verify that all three results match the NumPy reference. - Compare block sizes of 16 × 16, 32 × 8, and 8 × 32. Choose the best-performing size and explain the differences in terms of memory access coalescing.
- Fill in the “One Task, Five Implementations” table for NumPy, Numba
prange, CuPy, a custom kernel, and PyTorch. Record the execution time, speedup, implementation effort, and limitations for each. - Keep an optimization log with at least two iterations. Use the sequence “hypothesis → change → measurement → conclusion” for each iteration.