This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add skewed iteration distribution in static-steal schedule for hybrid systems
ClosedPublic

Authored by jlpeyton on Jun 14 2023, 1:35 PM.

Details

Summary

This commit adds skewed distribution of iterations in dynamic
schedule (static steal) for hybrid systems when thread affinity is assigned.
Currently, it distributes the iterations at 60:40 ratio. Consider this loop with
dynamic schedule type, for (int i = 0; i < 100; ++i)

In a hybrid system with 20 processes (16 CORE and 4 ATOM core), 88 iterations
will be assigned to performance cores and 12 iterations will be assigned to
efficient cores. Each thread with CORE core will process 5
iterations + extras and with ATOM core will process 3 iterations.

Diff Detail

Event Timeline

jlpeyton created this revision.Jun 14 2023, 1:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 1:35 PM
jlpeyton requested review of this revision.Jun 14 2023, 1:35 PM
Herald added a project: Restricted Project. · View Herald Transcript
jlpeyton updated this revision to Diff 545757.Jul 31 2023, 12:29 PM

Base on https://reviews.llvm.org/D156727 so topology information is consistent and fix accidental use of ds_gtid instead of ds_tid.

can we have a test for this?

openmp/runtime/src/kmp_dispatch.cpp
96

floats are not double precision

154

Probably easier to read if the non weighted case was handled first.

548

Is it really helping that we use a macro to elide the code? It makes the impl more complex for sure.

jlpeyton updated this revision to Diff 557677.Oct 10 2023, 3:31 PM

If its better to move this to GitHub, I can do that. Sorry, I had forgotten about this.

Test case still requires to be run on x86 with hybrid architecture (e.g., Alder Lake machine), but is now enabled.

I've compartmentalized the macro-guarded code for better readability, it's hard to remove the guard completely since the code relies on x86-specific guards (e.g., use of KMP_HW_CORE_TYPE_ATOM).

This revision was not accepted when it landed; it landed in state Needs Review.Nov 8 2023, 8:19 AM
This revision was automatically updated to reflect the committed changes.