Accelerating Python with Vectorized Numpy, Numba and JAX#

Scott Brandenberg, UCLA and Krishna Kumar, UT Austin

A Hands-On Tutorial Wednesday, March 27, 2024, 1:00pm - 2:30pm US Central Time

The webinar will feature a hands-on component using DesignSafe Jupyter, so please be sure to register for a DesignSafe user account if you don’t already have one. If your existing account is inactive, reactivate it by resetting your password.

Python is a popular programming language in natural hazards engineering research because it is free and open-source, and has a plethora of powerful packages for handling our community’s computing needs. However, Python is an interpreted language and is inherently slower and less efficient than compiled languages like Fortran, C, and C++. As a result, many scripts written in Python, particularly those involving loops, can run significantly faster with a few minor modifications. This webinar will demonstrate how vectorized calculations using Numpy arrays are significantly faster than the same operations coded in Python. We will demonstrate how to use just in time (JIT) compilation and JAX (Numpy on steroids) to accelerate Python, particularly using GPU’s. Finally, we will use a published dataset to show how to directly access the >1PB of data published through DesignSafe (no download required!).