Skip to content
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

Fix oversubscription with CHPL_LOCALE_MODEL=gpu #26059

Merged
merged 6 commits into from
Oct 9, 2024
Merged

Conversation

jhh67
Copy link
Contributor

@jhh67 jhh67 commented Oct 8, 2024

The PRs to add GPU support to co-locales (PRs #25734 and #25846) broke oversubscription such that no locales had any GPUs. This PR fixes that problem, and cleans up resource allocation with co-locales in general. Oversubscription is handled more cleanly, as is the "remainder" node that occurs when the number of locales is not evenly divisible by the number of nodes.

Signed-off-by: John H. Hartman jhh67@users.noreply.github.com

jhh67 added 5 commits October 8, 2024 09:13
Don't crash if the logical accessible CPU set for a locale isn't set.

Signed-off-by: John H. Hartman <jhh67@users.noreply.github.com>
Signed-off-by: John H. Hartman <jhh67@users.noreply.github.com>
Signed-off-by: John H. Hartman <jhh67@users.noreply.github.com>
If we are oversubscribed then the locales should share the devices, instead
of treating them as co-locales and partitioning the devices

Signed-off-by: John H. Hartman <jhh67@users.noreply.github.com>
If the number of nodes does not evenly divide the number of locales there will
be a "remainder node" that has fewer co-locales than the other nodes.
Previously, there was some special-casing to deal with the remainder node
which was clunky and error-prone. This commit introduces the "partition"
abstraction in which the number of partitions on each node is the expected
number of co-locales on the node. All nodes, including the remainder node,
allocate resources based on partitions, then assign co-locales to partitions.
On the remainder node this means that some partitions (and therefore
resources) go unused, but this is what we want because all locales should
have the same amount of resources. This greatly cleans up the code.

In addition, oversubscription handling is cleaner. If there are locales on
the node, but the expected number of co-locales is zero, the node is
oversubscribed and all locales share all resources.

Also added some remainder node and oversubsciption tests.

Signed-off-by: John H. Hartman <jhh67@users.noreply.github.com>
@jhh67 jhh67 requested a review from jabraham17 October 9, 2024 13:41
@jhh67 jhh67 marked this pull request as ready for review October 9, 2024 13:41
Signed-off-by: John H. Hartman <jhh67@users.noreply.github.com>
@jhh67 jhh67 merged commit 75028c6 into chapel-lang:main Oct 9, 2024
7 checks passed
@jhh67 jhh67 deleted the gpu branch October 9, 2024 21:40
@bradcray
Copy link
Member

@jhh67 : Does this resolve #25989?

@e-kayrakli : And presumably that user's GPU/SMP case that you were helping me with last week as well?

@jhh67
Copy link
Contributor Author

jhh67 commented Oct 10, 2024

@bradcray: I realized last night I forgot to close the issues resolved by the PRs I merged yesterday. I will do it today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants