-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bold warnings when using preferred many memory binding scheme on a kernel that does not support it #668
Comments
Hello. We already have a debug message:
I guess I can make it a normal warning at least in hwloc-bind. And make it easier to understand. However, if they are using the C API, we have many users who don't want underlying libraries to print warnings/errors. |
100% agree :) |
Quick question while working on the writing of the warning: if these people are coming back to you with performance degradation, it means that they are filling multiple entire NUMA nodes with huge allocations? If so, PREFERRED_MANY fills all the given nodes before moving to anything else, while PREFERRED uses anything else as soon as the first node is full. Correct? |
Here's a wording proposal:
This non-critical error message is not shown by default in the library, but lstopo and now hwloc-bind increase verbosity to show it by default. |
The application is not filling the NUMA node. Performance degradation comes from redirecting all the allocation, hence all transfers, onto 1 NUMA only, and hence 1 chanel, instead of multiple. This has 3 effects :
This can easily be observed with a stream. I ran a 20GB stream on this machine (showing only 1 out of 2 sockets), that easily fits in any of the NUMA :
Binding to 4 numas gives around 240GB/s, whereas binding to numa 0 only gives around 60GB/s (little less than 1/4 as expected due to contention & increased distance for numa 1-3). Since 20GB fit in one numa, using preferred many leads to the same result as Stream is pathological. Depending on the application (and its tendency to use memory) the impact can be different. |
Hmmm, so preferred_many does some sort of interleaving? I thought it would fill the first node only, then the second one, then 3rd, etc. |
I am with kernel pre 5.15, so this is silently ignoring preferred many in the last example. A typical example of why people are coming back to me with perf degradation, and where I want the warning message to pop :) |
…rted Old kernels such as 5.14 in RHEL9 don't support MPOL_PREFERRED_MANY, we fallback to MPOL_PREFERRED which uses only the first given node, leading to less performance. Change the warning into a non-critical error and clarify it. Refs #668 Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
So that the MPOL_PREFERRED warning (from commit 04e76a205d6df7ed44be0e5538f7e554c835b6f7) is shown Refs #668 Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
…rted Old kernels such as 5.14 in RHEL9 don't support MPOL_PREFERRED_MANY, we fallback to MPOL_PREFERRED which uses only the first given node, leading to less performance. Change the warning into a non-critical error and clarify it. Refs #668 Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr> (cherry picked from commit 05a1435)
…rted Old kernels such as 5.14 in RHEL9 don't support MPOL_PREFERRED_MANY, we fallback to MPOL_PREFERRED which uses only the first given node, leading to less performance. Change the warning into a non-critical error and clarify it. Refs #668 Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr> (cherry picked from commit 05a1435)
I just pushed the changes. They will be in 2.11 and maybe in a 2.10.1 (but not sure yet if I'll release that one). The plan is to release rc1 next week. |
I am posting 2.11rc1 right now with this fix. |
What version of hwloc are you using?
Several versions from 2.2.0 up to 2.10.0
Which operating system and hardware are you running on?
Several OS (ubuntu 22, rhel 8) on several machines (Intel, AMD, AWS Graviton, Nvidia Grace, etc.)
Details of the problem
Hello,
hwloc uses the "preferred many" memory binding scheme by default when specifying several memories, as stated here #236
However this memory binding scheme is available from Linux kernel 5.15, and many systems are using previous versions of the Linux kernel. Even Redhat 9 is shipped with the linux kernel 5.14.
I am a hwloc evangelist, and managed to convince many people to move to this tool. However too many are actually coming back to me with perf degradation using
hwloc-bind --membind numa:0-3 $EXE
. Indeed, the kernel picks the first memory, and silently ignores the remaining ones. I also countered the issue some time ago (#601).I think hwloc could detect such situation where the user is using preferred many on a kernel that does not support it, then print a bold warning recommending to upgrade the kernel, or use
--strict
instead, with some link to some documentation (this ticket for instance 😇 ), or anything else to help the user.Best.
The text was updated successfully, but these errors were encountered: