Skip to content
0:00 / 0:00

#julia#taskscheduling#depth-firstscheduling

Shared memory parallelism in Julia | Kiran Pamnany | Cambridge Julia Meetup (May 2018)

The Julia Programming Language

91K subscribers • 17 videos on Hallway

YouTube

Advanced. Deep dive for people who know the field.

6.7K views8 years ago4 recommendations

Programming languagesSystems programmingConcurrency and parallelismPerformance and optimization

Kiran Pamnany explains why traditional fork-join and work-stealing models fail to nest parallel code effectively and presents depth-first scheduling in Julia.

A fast, efficient scheduler for parallel programming Parallel programming is essential for high performance on current processor and system architectures. Many libraries include carefully tuned parallel implementations of their functionality, but using these in a parallel program requires effective nested parallelism. We show that existing threading models such as fork-join (OpenMP) and work-stealing (Cilk/TBB/Go) fail to nest parallel code effectively, making these highly tuned parallel libraries near useless to parallel programs; a state of affairs we do not wish to inflict on Julia. A decade-old idea, parallel depth-first scheduling, offers hope. We show the promise of this approach and report on our implementation of PDF scheduling in Julia. Speaker: Kiran Pamnany is a research scientist in Intel’s Parallel Computing Lab. His research interests include programming models, high performance computing and compilers. He is the author of Julia’s existing experimental threading runtime as well as Julia’s forthcoming parallel task runtime, and is one of the people responsible for Julia joining the petaflop club with Celeste. He has a PhD in computer science from Brown University. Time Stamps: Contents Welcome! Why we need threads? Task parallelism Data parallelism Julia's experimental threading infrastructure added in 2015/2016 Successes of aforementioned threading infrastructure What we've learned Problem is not adding threads to Julia, but making them useful at every level Nested parallelism: parallel code calling function from a library that is also parallel Example: multiplying two n x n matrices Example: running code sequentially Example: you need O(n^2) space Example: running code in parallel on 4 cores with OpenMP, OMP_NESTED = 1 Example: such parallel code needs O(n^3) in space Another way: work-stealing Problem: work-stealing algorithm essentially run like a serial algorithm Parallel depth-first scheduling partr -- parallel task runtime partr implementation partr -- priority queues partr -- handling nested parallelism Possible problem: we do not synchronize at each spawn point Why all these things are important? Q&A: is Julia more suitable for implementation of partr than other languages? S/O to github.com/KZiemian for the video timestamps! Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: github.com/JuliaCommunity/YouTubeVideoTimestamps Interested in improving the auto generated captions? Get involved here: github.com/JuliaCommunity/YouTubeVideoSubtitles

Why it's here

4 people recommend this

What people say. Recommended as an insightful overview of Julia's parallel task runtime and how its depth-first scheduling algorithm avoids blocking threads.

jrevelson Hacker News • Recommends

On “Julia parallel task runtime (WIP)”

This work has been a monumental collaborative effort and I think the eventual outcome will be pretty spectacular. I gave a talk at an MIT Julia meetup a few months ago that the author of this PR also spoke at; I found his talk to be an insightful overview of this work: link to this video

boromion Hacker News • Recommends

On “Julia parallel task runtime (WIP)”

checkout link to this video which explains the new features of the task scheduler in a simple fashion. Basically Julia is employing a new algorithm to schedule tasks, where traditional methods would get stuck/blocked. Essentially, if you run a job with parallel tasks and one of the threads finishes, it's extremely difficult to schedulate the free thread, since the data may still be used by the other threads that are busy; thus you need to have clever way to determine how to allocate computational resources. Julia is implementing results of a new paper on how to optimally do this.

StefanKarpinskion Hacker News • Recommends

On “Composable multi-threaded parallelism in Julia”

Consider a machine with N cores running a program which spawns N parallel tasks, each of which in turn spawns N parallel tasks. Which subtasks do the cores work on initially? If it's the first subtask of each top-level task, that's breadth-first scheduling. If it's all N subtasks of the first top-level task, that's depth-first scheduling. The latter is better for high-performance computing because it tends to be the lower level libraries that are really carefully tuned to make optimal use of the machine (think BLAS/FTT/parallel sum/prefix sum). Previously it was unknown how to implement this kind of scheduling efficiently. See this talk by Kiran Pamnany for more details: link to this video

falkaeron Hacker News • Recommends

On “Julia v1.3”

By far the most interesting part of this release is the new multi-threading features, I recommend reading link for an overview, and watching link to this video for a talk about some unique stuff that's being worked on with Julia's multi-threading (though the depth-first scheduling is not in 1.3 afaik).

oconnor663on Hacker News • Mentions

On “Julia v1.3”

Does the Rust Rayon library have the issue the speaker was describing, where parallel inner loops mostly get executed serially once an outer loop is parallelized? (I assume it does, from its Cilk heritage?) Are there workarounds for when that is a problem? Edit: Dumb mistake on my part. I was looking at the video linked in the top comment ( link to this video ) and then I came back to this thread and thought it was the topic.