Pinning Julia Threads to CPU-Cores with ThreadPinning.jl

07/26/2023, 3:40 PM — 3:50 PM UTC
32-141

Abstract:

Have you ever wondered how to bind a thread to a specific CPU-core in Julia? And why that might be useful in the first place? Then this talk is for you! I demonstrate how to easily query and control the affinity of your Julia threads using ThreadPinning.jl and present instructive examples that highlight the importance of thread pinning, especially on HPC clusters.

Description:

In this talk, I will introduce ThreadPinning.jl, a Julia package that makes controlling the affinity of your Julia threads simple (and fun!). First, you'll learn how to get an overview of the system topology and find out where your Julia threads are currently running. I'll then explain how to readily pin your Julia threads to specific cores, sockets, or memory domains (NUMA) either interactively from inside the Julia REPL or via environment variables or Julia preferences. Applying these techniques, we will study a few instructive examples, such as a (memory bound) streaming kernel, to understand the impact of thread pinning. In particular, we'll consider different pinning schemes on a typical HPC cluster node (dual-socket system). Finally, I'll give an outlook on future features (e.g. interactively pinning BLAS threads) and discuss potential Windows support.

Disclaimer: Linux only (for now)

Platinum sponsors

JuliaHub

Gold sponsors

ASML

Silver sponsors

Pumas AIQuEra Computing Inc.Relational AIJeffrey Sarnoff

Bronze sponsors

Jolin.ioBeacon Biosignals

Academic partners

NAWA

Local partners

Postmates

Fiscal Sponsor

NumFOCUS