This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomp] avoid spin wait and yield on arm64 macOS
ClosedPublic

Authored by danieljdouglas-deco on May 26 2022, 5:07 PM.

Details

Summary

This patch changes the default behavior to avoid spin waiting and yielding. (See “Don’t Keep Threads Active And Idle” section here: https://developer.apple.com/documentation/apple-silicon/tuning-your-code-s-performance-for-apple-silicon)

We verified using instruments traces that the changes improve scheduling behavior on macOS.

We also collected results using EPCC schedbench (https://github.com/LangdalP/EPCC-OpenMP-micro-benchmarks) that are attached here that show a reduction in standard deviation and max test run time across all scheduling types. Static scheduling sees dramatic improvements with these changes, we see a 2-4x average runtime improvement in the benchmark.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 5:07 PM
danieljdouglas-deco requested review of this revision.May 26 2022, 5:07 PM
danieljdouglas-deco edited the summary of this revision. (Show Details)May 26 2022, 5:18 PM
This revision is now accepted and ready to land.Jun 22 2022, 12:04 PM

Daniel, do you need us to commit on your behalf?

Daniel, do you need us to commit on your behalf?

Yes please, and thanks for the review!

This revision was automatically updated to reflect the committed changes.