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

[FEA] Create MIG with Cgroups on YARN Dataproc scripts #5261

Closed
tgravescs opened this issue Apr 15, 2022 · 1 comment · Fixed by #5283
Closed

[FEA] Create MIG with Cgroups on YARN Dataproc scripts #5261

tgravescs opened this issue Apr 15, 2022 · 1 comment · Fixed by #5283
Assignees
Labels
feature request New feature or request

Comments

@tgravescs
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
We found a way to make MIG work with Cgroups on YARN without modifications to yarn. Get this running on Dataproc and create the necessary initialization scripts.

@tgravescs tgravescs added the feature request New feature or request label Apr 15, 2022
@tgravescs tgravescs self-assigned this Apr 15, 2022
@sameerz sameerz changed the title [FEA]. Create MIG with Cgroups on YARN Dataproc scripts [FEA] Create MIG with Cgroups on YARN Dataproc scripts Apr 18, 2022
@tgravescs
Copy link
Collaborator Author

tgravescs commented Apr 18, 2022

One way we can get this to work is by making YARN use the major/minor device numbers for the MIG GI access nodes when it denies access via Cgroups. By denying access to the GI, it denies access to all CI's underneath it.
To get this to work we need to have a wrapper nvidia-smi script and use the container-executor.cfg configuration to override the gpu major device number.

  1. modify https://github.com/NVIDIA/spark-rapids-examples/blob/branch-22.04/examples/MIG-Support/yarn-unpatched/scripts/mig2gpu.sh to return the GI access node as the GPU minor device id (/proc/driver/nvidia-caps/mig-minors | grep gpu0/gi1/access). ie the script still enumerates all MIG devices like they are normal GPUs with the modified minor device number. Install this script on each node.
  2. Update yarn.env.sh and yarn-site.xml per https://github.com/NVIDIA/spark-rapids-examples/tree/branch-22.04/examples/MIG-Support/yarn-unpatched and new option added in step 1
  3. On each node, add the gpu.major-device-number = grep nvidia-caps /proc/devices to the container-executor.cfg file. This has to be per node because different nodes could have different numbers.

With the above changes, YARN will internally pass the major and minor devices for mig GI access to the container-executor to add all GPU MIG devices that this container shouldn't have access to the Cgroup Deny list for that container.

To do this on Dataproc we need an option for user to enable MIG with scripts to do it. This requires A100's and MIG to be enabled and then a reboot to happen for it to take affect. The only way I found to do that is using the --metadata=startup-script-url= option and in that script it installs gpu drivers and enables mig, then does a reboot. On reboot that script will get run again and the script has to configure MIG CI instances per user and then do the normal YARN and spark rapids plugin install and initialization.

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

Successfully merging a pull request may close this issue.

1 participant