A Deep Dive into Task-Based Parallelism in Python

William Ruys, Hochan Lee, Bozhi You, Shreya Talati, Jaeyoung Park, James Almgren-Bell, Yineng Yan, Milinda Fernando, George Biros, Mattan Erez, Martin Burtscher, Christopher J. Rossbach, Keshav K. Pingali, Milos Gligoric · 2024

Modern Python programs in high-performance computing call into compiled libraries and kernels for performance-critical tasks. However, effectively parallelizing these finer-grained, and often dynamic, kernels across modern heterogeneous platforms remains a challenge. First, we perform an experimental study to examine the impact of Python's Global Interpreter Lock (GIL), and potential speedups under a GIL-less PEP703 future, to guide runtime design. Using our optimized runtime, we explore scheduling tasks with constraints that require resources across multiple, potentially diverse, devices through the introduction of new programming abstractions and runtime mechanisms. We extend an existing Python tasking library, Parla, to augment its performance and add support for such multi-device tasks. Our experimental analysis, using tasks graphs from synthetic and real applications, shows at least a 3 ×(and up to 6 ×) performance improvement over its predecessor in scenarios with high GIL contention. When scheduling multi-GPU tasks, we observe an 8x reduction in per-task launching overhead compared to a multi-process system.

Read the paper · More papers on PaperTik