This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Disable hidden helper task by default
AbandonedPublic

Authored by tianshilei1992 on Mar 20 2021, 9:59 AM.

Details

Reviewers
jdoerfert
ronlieb
Summary

Performance regression is reported in D98838 when enabling hidden helper thread. This patch disables it by default.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Mar 20 2021, 9:59 AM
tianshilei1992 requested review of this revision.Mar 20 2021, 10:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2021, 10:00 AM

Thanks for putting up this change, just a few comments.

openmp/runtime/src/kmp_runtime.cpp
8648

i tried this patch and found that i still needed to set

LIBOMP_NUM_HIDDEN_HELPER_THREADS=0

would it make sense to set the default to 0 instead of 8?

openmp/runtime/src/kmp_settings.cpp
1224

is this function called only when the environment variable is explicitly set in the environment?

tianshilei1992 added inline comments.Mar 20 2021, 6:02 PM
openmp/runtime/src/kmp_runtime.cpp
8648

Yeah, that's a nice catch. It is this "hole" in __kmp_threads affecting the performance from my wild guess. I'll set it to 0 for now and fix it later. Thanks.

openmp/runtime/src/kmp_settings.cpp
1224

You're right.

tianshilei1992 marked 2 inline comments as done.Mar 20 2021, 6:23 PM
tianshilei1992 added inline comments.
openmp/runtime/src/kmp_settings.cpp
1227

This is kind of a temporary solution here. If LIBOMP_USE_HIDDEN_HELPER_TASK is set, __kmp_hidden_helper_threads_num is set to 8.

jdoerfert added a comment.EditedMar 21 2021, 9:53 AM

@ronlieb, looks good?

[AMD Official Use Only - Internal Distribution Only]

Testing it now

Get Outlook for iOShttps://aka.ms/o0ukef


From: Johannes Doerfert via Phabricator <reviews@reviews.llvm.org>
Sent: Sunday, March 21, 2021 12:53:31 PM
To: tianshilei1992@gmail.com <tianshilei1992@gmail.com>; jdoerfert@anl.gov <jdoerfert@anl.gov>
Cc: Lieberman, Ron <Ron.Lieberman@amd.com>; Liu, Yaxun (Sam) <Yaxun.Liu@amd.com>; stefomeister@gmail.com <stefomeister@gmail.com>; zhang.guansong@gmail.com <zhang.guansong@gmail.com>; openmp-commits@lists.llvm.org <openmp-commits@lists.llvm.org>; Kumar N, Bhuvanendra <Bhuvanendra.KumarN@amd.com>; lin32@llnl.gov <lin32@llnl.gov>; Singh, Pushpinder <Pushpinder.Singh@amd.com>; liao6@llnl.gov <liao6@llnl.gov>; sara.royuela@bsc.es <sara.royuela@bsc.es>; Islam, Saiyedul <Saiyedul.Islam@amd.com>; Tomar, Sourabh Singh <SourabhSingh.Tomar@amd.com>; deepak.eachempati@hpe.com <deepak.eachempati@hpe.com>; xw111luoye@gmail.com <xw111luoye@gmail.com>; jatin.bhateja@gmail.com <jatin.bhateja@gmail.com>; greg63706@gmail.com <greg63706@gmail.com>; ravi.narayanaswamy@intel.com <ravi.narayanaswamy@intel.com>; a.bataev@hotmail.com <a.bataev@hotmail.com>
Subject: [PATCH] D99020: [OpenMP] Disable hidden helper task by default

[CAUTION: External Email]

jdoerfert added a comment.

@ronlib, looks good?

Repository:

rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD99020%2Fnew%2F&amp;data=04%7C01%7Cron.lieberman%40amd.com%7C3ad37352fe4a4eedad0a08d8ec89dc7d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637519424152202471%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=YBEUHHc%2BUmjwT80NieUoLjo%2FQAJoLWMLx16npDTy9OI%3D&amp;reserved=0

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD99020&amp;data=04%7C01%7Cron.lieberman%40amd.com%7C3ad37352fe4a4eedad0a08d8ec89dc7d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637519424152202471%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=e%2FFTbFgb2gKOGMuSyHeaRKSelewsbGIBbZIooFI2wrg%3D&amp;reserved=0

ronlieb accepted this revision.Mar 21 2021, 10:53 AM

619.lbm looks good base and peak.
Testing all of fpspeed base, should have result in an hour or two.
but i think it is good.

This revision is now accepted and ready to land.Mar 21 2021, 10:53 AM

fpspeed base - looks good.

planning to land this ?

tianshilei1992 added a comment.EditedMar 23 2021, 8:39 AM

planning to land this ?

It will not be landed because it's not for trunk. I've filed a ticket to request the release manager to pick the patch to the release branch.
https://bugs.llvm.org/show_bug.cgi?id=49673 FYI

tianshilei1992 abandoned this revision.May 13 2021, 5:20 PM

This patch is useless as the performance issue was fixed.