<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Mathias</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I can't answer your specific question, so this is more of a comment <span contenteditable="false" id="🙂">
🙂</span> </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We have a system with 8 x Nvidia A40, where we would like to share each GPU between several jobs (they have 48GB each), eg starting 32 jobs, with 4 on each GPU. I looked into MIG as well, but unfortunately that is not supported by the A40 hardware (only A30
 and A100). <br>
I have tried MPS, but strangely that works only for the first GPU on each node, so only one of the 8 GPUs in our system can be shared in this way. That is, it used to be like that. A couple of weeks ago, an "all_sharing" flag was introduced for gres.conf, which
 apparently should make it possible to share all the GPUs with MPS. I haven't tried it yet, but it may be worth a try. It should be possible to configure some GPUs as mps and some as gpu resources.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Esben</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://github.com/SchedMD/slurm/blob/master/doc/man/man5/gres.conf.5" id="LPlnk909484">https://github.com/SchedMD/slurm/blob/master/doc/man/man5/gres.conf.5</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<table class="highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file" data-tab-size="8" data-paste-markdown-skip="" data-tagsearch-lang="Roff Manpage" data-tagsearch-path="doc/man/man5/gres.conf.5" style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;tab-size:8;color:rgb(36, 41, 47);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:14px;background-color:rgb(255, 255, 255)">
<tbody style="box-sizing:border-box">
<tr style="box-sizing:border-box">
<td class="blob-code blob-code-inner js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;color:var(--color-fg-default)">
<span class="pl-mh" style="box-sizing:border-box;font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)"><span class="pl-mb" style="box-sizing:border-box;color:var(--color-prettylights-syntax-markup-bold)">all_sharing</span></span></td>
</tr>
<tr style="box-sizing:border-box">
<td class="blob-num js-line-number js-code-nav-line-number" data-line-number="197" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;vertical-align:top;cursor:pointer;user-select:none">
</td>
<td class="blob-code blob-code-inner js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;color:var(--color-fg-default)">
To be used on a shared gres. This is the opposite of one_sharing and can be</td>
</tr>
<tr style="box-sizing:border-box">
<td class="blob-num js-line-number js-code-nav-line-number" data-line-number="198" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;vertical-align:top;cursor:pointer;user-select:none">
</td>
<td class="blob-code blob-code-inner js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;color:var(--color-fg-default)">
used to allow all sharing gres (gpu) on a node to be used for shared gres (mps).</td>
</tr>
<tr style="box-sizing:border-box">
<td class="blob-num js-line-number js-code-nav-line-number" data-line-number="199" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;vertical-align:top;cursor:pointer;user-select:none">
</td>
<td class="blob-code blob-code-inner js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;color:var(--color-fg-default)">
</td>
</tr>
<tr style="box-sizing:border-box">
<td class="blob-num js-line-number js-code-nav-line-number" data-line-number="200" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;vertical-align:top;cursor:pointer;user-select:none">
</td>
<td class="blob-code blob-code-inner js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;color:var(--color-fg-default)">
NOTE: If a gres has this flag configured it is global, so all other nodes with</td>
</tr>
<tr style="box-sizing:border-box">
<td class="blob-num js-line-number js-code-nav-line-number" data-line-number="201" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;vertical-align:top;cursor:pointer;user-select:none">
</td>
<td class="blob-code blob-code-inner js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;color:var(--color-fg-default)">
that gres will have this flag implied.  This flag is not combatible with</td>
</tr>
<tr style="box-sizing:border-box">
<td class="blob-num js-line-number js-code-nav-line-number" data-line-number="202" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;vertical-align:top;cursor:pointer;user-select:none">
</td>
<td class="blob-code blob-code-inner js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;font-size:12px;color:var(--color-fg-default)">
one_sharing for a specific gres.</td>
</tr>
</tbody>
</table>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> slurm-users <slurm-users-bounces@lists.schedmd.com> on behalf of Matthias Leopold <matthias.leopold@meduniwien.ac.at><br>
<b>Sent:</b> Thursday, January 27, 2022 16:27<br>
<b>To:</b> Slurm User Community List <slurm-users@lists.schedmd.com><br>
<b>Subject:</b> [slurm-users] addressing NVIDIA MIG + non MIG devices in Slurm</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi,<br>
<br>
we have 2 DGX A100 systems which we would like to use with Slurm. We <br>
want to use the MIG feature for _some_ of the GPUs. As I somehow <br>
suspected I couldn't find a working setup for this in Slurm yet. I'll <br>
describe the configuration variants I tried after creating the MIG <br>
instances, it might be a longer read, please bear with me.<br>
<br>
1. using slurm-mig-discovery for gres.conf <br>
(<a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.com%2Fnvidia%2Fhpc%2Fslurm-mig-discovery&amp;data=04%7C01%7Cepf%40novozymes.com%7Ca0989487f14947bd269808d9e1a99cc4%7C43d5f49ee03a4d22a2285684196bb001%7C0%7C0%7C637788940862367005%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=AHN8h8%2FcB4xeC7MFdYgZRG7L62PTiz4OvampC1vWL5Q%3D&amp;reserved=0">https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.com%2Fnvidia%2Fhpc%2Fslurm-mig-discovery&amp;data=04%7C01%7Cepf%40novozymes.com%7Ca0989487f14947bd269808d9e1a99cc4%7C43d5f49ee03a4d22a2285684196bb001%7C0%7C0%7C637788940862367005%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=AHN8h8%2FcB4xeC7MFdYgZRG7L62PTiz4OvampC1vWL5Q%3D&amp;reserved=0</a>)<br>
- CUDA_VISIBLE_DEVICES: list of indices<br>
-> seems to bring a working setup and full flexibility at first, but <br>
when taking a closer look the selection of GPU devices is completely <br>
unpredictable (output of nvidia-smi inside Slurm job)<br>
<br>
2. using "AutoDetect=nvml" in gres.conf (Slurm docs)<br>
- CUDA_VISIBLE_DEVICES: MIG format (see <br>
<a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.nvidia.com%2Fcuda%2Fcuda-c-programming-guide%2Findex.html%23env-vars&amp;data=04%7C01%7Cepf%40novozymes.com%7Ca0989487f14947bd269808d9e1a99cc4%7C43d5f49ee03a4d22a2285684196bb001%7C0%7C0%7C637788940862367005%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=ZFXeCQh3%2FLO52zpiOqn7CROjq7wvj8zWRE8mj87P%2Bew%3D&amp;reserved=0)">https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.nvidia.com%2Fcuda%2Fcuda-c-programming-guide%2Findex.html%23env-vars&amp;data=04%7C01%7Cepf%40novozymes.com%7Ca0989487f14947bd269808d9e1a99cc4%7C43d5f49ee03a4d22a2285684196bb001%7C0%7C0%7C637788940862367005%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=ZFXeCQh3%2FLO52zpiOqn7CROjq7wvj8zWRE8mj87P%2Bew%3D&amp;reserved=0)</a><br>
<br>
2.1 converting ALL GPUs to MIG<br>
- also a full A100 is converted to a 7g.40gb MIG instance<br>
- gres.conf: "AutoDetect=nvml" only<br>
- slurm.conf Node Def: naming all MIG types (read from slurmd debug log)<br>
-> working setup<br>
-> problem: IPC (MPI) between MIG instances not possible, this seems to <br>
be a by-design limitation<br>
<br>
2.2 converting SOME GPUs to MIG<br>
- some A100 are NOT in MIG mode<br>
<br>
2.2.1 using "AutoDetect=nvml" only (Variant 1)<br>
- slurm.conf Node Def: Gres with and without type<br>
-> problem: fatal: _foreach_slurm_conf: Some gpu GRES in slurm.conf have <br>
a type while others do not (slurm_gres->gres_cnt_config (26) > tmp_count <br>
(21))<br>
<br>
2.2.2 using "AutoDetect=nvml" only (Variant 2)<br>
- slurm.conf Node Def: only Gres without type (sum of MIG + non MIG)<br>
-> problem: different GPU types can't be requested<br>
<br>
2.2.3 using partial "AutoDetect=nvml"<br>
- gres.conf: "AutoDetect=nvml" + hardcoding of non MIG GPUs<br>
- slurm.conf Node Def: MIG + non MIG Gres types<br>
-> produces a "perfect" config according to slurmd debug log<br>
-> problem: the sanity-check mode of "AutoDetect=nvml" prevents <br>
operation (?)<br>
-> Reason=gres/gpu:1g.5gb count too low (0 < 21) [slurm@2022-01-27T11:23:59]<br>
<br>
2.2.4 using static gres.conf with NVML generated config<br>
- using a gres.conf with NVML generated config where I can define the <br>
type for non MIG GPU and also set the UniqueId for MIG instances would <br>
be the perfect solution<br>
- slurm.conf Node Def: MIG + non MIG Gres types<br>
-> problem: it doesn't work<br>
-> Parsing error at unrecognized key: UniqueId<br>
<br>
Thanks for reading this far. Am I missing something? How can MIG and non <br>
MIG devices be addressed in a cluster? This setup of having MIG and non <br>
MIG devices can't be exotic, since having ONLY MIG devices has severe <br>
disadvantages (see 2.1). Thanks again for any advice.<br>
<br>
Matthias<br>
<br>
</div>
</span></font></div>
</body>
</html>