NumbaSummarizer: A Python Library for Simplified Vectorization Reports
Neftali Watkinson, Preston Tai, Alexandru Eugen Nicolau, Alexander V. Veidenbaum · 2020
Python is a very popular programming language and has been adopted by many learning institutions as the first or only programming language taught to students. While its simple syntax and gentle learning curve makes it a very attractive option for new programmers, among its main drawbacks are that it obviates many key concepts of programming and computer architecture as well as rarely optimizing code to modern architectures.There are tools that provide optimizing capability for Python programmers. Numba is a JIT compiler for Python that among other things, optimizes Python and Numpy functions for better performance. Numba can exploit automatic parallelism and vectorization.In this paper we present NumbaSummarizer, a wrapper for Numba's vectorization module that works as a vectorization reporting tool. Students can use it to identify functions that are exploiting SIMD instructions. The main purpose of this tool is to teach students about Parallel Computing, Vectorization, Data Dependence, and Loop Transformations.We evaluated the use of NumbaSummarizer with 64 students during a course on intermediate programming. Most students had little to no background in Computer Architecture nor Parallel Computing. When asked to expose parallelism in a set of 8 loops, 95% percent of the students were able to transform and optimize at least 6 of these loops. When testing conceptual understanding, they scored an average of 95% for parallel computing concepts, and 62% for dependence analysis.