Skip to content

Commit ba42432

Browse files
committed
Add global variable to hold placement information for all GIs and CIs
For now this only holds GI placement information with placeholders for the CI placement informatin. It should need to be extended to hold CI placement information in the future. Signed-off-by: Kevin Klues <[email protected]>
1 parent b72647c commit ba42432

File tree

1 file changed

+155
-0
lines changed

1 file changed

+155
-0
lines changed

pkg/nvml/mock/dgxa100/dgxa100.go

+155
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,161 @@ var MIGProfiles = struct {
345345
},
346346
}
347347

348+
var MIGPlacements = struct {
349+
GpuInstancePossiblePlacements map[int][]nvml.GpuInstancePlacement
350+
ComputeInstancePossiblePlacements map[int]map[int][]nvml.ComputeInstancePlacement
351+
}{
352+
GpuInstancePossiblePlacements: map[int][]nvml.GpuInstancePlacement{
353+
nvml.GPU_INSTANCE_PROFILE_1_SLICE: {
354+
{
355+
Start: 0,
356+
Size: 1,
357+
},
358+
{
359+
Start: 1,
360+
Size: 1,
361+
},
362+
{
363+
Start: 2,
364+
Size: 1,
365+
},
366+
{
367+
Start: 3,
368+
Size: 1,
369+
},
370+
{
371+
Start: 4,
372+
Size: 1,
373+
},
374+
{
375+
Start: 5,
376+
Size: 1,
377+
},
378+
{
379+
Start: 6,
380+
Size: 1,
381+
},
382+
},
383+
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1: {
384+
{
385+
Start: 0,
386+
Size: 1,
387+
},
388+
{
389+
Start: 1,
390+
Size: 1,
391+
},
392+
{
393+
Start: 2,
394+
Size: 1,
395+
},
396+
{
397+
Start: 3,
398+
Size: 1,
399+
},
400+
{
401+
Start: 4,
402+
Size: 1,
403+
},
404+
{
405+
Start: 5,
406+
Size: 1,
407+
},
408+
{
409+
Start: 6,
410+
Size: 1,
411+
},
412+
},
413+
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2: {
414+
{
415+
Start: 0,
416+
Size: 2,
417+
},
418+
{
419+
Start: 2,
420+
Size: 2,
421+
},
422+
{
423+
Start: 4,
424+
Size: 2,
425+
},
426+
{
427+
Start: 6,
428+
Size: 2,
429+
},
430+
},
431+
nvml.GPU_INSTANCE_PROFILE_2_SLICE: {
432+
{
433+
Start: 0,
434+
Size: 2,
435+
},
436+
{
437+
Start: 2,
438+
Size: 2,
439+
},
440+
{
441+
Start: 4,
442+
Size: 2,
443+
},
444+
},
445+
nvml.GPU_INSTANCE_PROFILE_3_SLICE: {
446+
{
447+
Start: 0,
448+
Size: 4,
449+
},
450+
{
451+
Start: 4,
452+
Size: 4,
453+
},
454+
},
455+
nvml.GPU_INSTANCE_PROFILE_4_SLICE: {
456+
{
457+
Start: 0,
458+
Size: 4,
459+
},
460+
},
461+
nvml.GPU_INSTANCE_PROFILE_7_SLICE: {
462+
{
463+
Start: 0,
464+
Size: 8,
465+
},
466+
},
467+
},
468+
// TODO: Fill out ComputeInstancePossiblePlacements
469+
ComputeInstancePossiblePlacements: map[int]map[int][]nvml.ComputeInstancePlacement{
470+
nvml.GPU_INSTANCE_PROFILE_1_SLICE: {
471+
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
472+
},
473+
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1: {
474+
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
475+
},
476+
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2: {
477+
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
478+
},
479+
nvml.GPU_INSTANCE_PROFILE_2_SLICE: {
480+
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
481+
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
482+
},
483+
nvml.GPU_INSTANCE_PROFILE_3_SLICE: {
484+
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
485+
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
486+
nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: {},
487+
},
488+
nvml.GPU_INSTANCE_PROFILE_4_SLICE: {
489+
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
490+
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
491+
nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: {},
492+
},
493+
nvml.GPU_INSTANCE_PROFILE_7_SLICE: {
494+
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
495+
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
496+
nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: {},
497+
nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: {},
498+
nvml.COMPUTE_INSTANCE_PROFILE_7_SLICE: {},
499+
},
500+
},
501+
}
502+
348503
func New() nvml.Interface {
349504
return &Server{
350505
Devices: [8]nvml.Device{

0 commit comments

Comments
 (0)