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

Partitionable model with generated partitions #32

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix partition names
  • Loading branch information
johnbelamaric committed Jun 16, 2024
commit 6c42a17be09fabfdd2fe3ef41f8a05c43c6f54cc
8 changes: 7 additions & 1 deletion dra-evolution/pkg/gen/nvidia.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gen

import (
"fmt"
"strings"

"github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100"
"github.com/kubernetes-sigs/wg-device-management/dra-evolution/pkg/api"
Expand Down Expand Up @@ -98,8 +99,13 @@ func dgxa100Pool(nodeName, poolName string, gpus int) (*api.ResourcePool, error)
}

func instanceToPartition(instance newresourceapi.NamedResourcesInstance, partitionAttrs map[string]bool) api.DevicePartition {
name := strings.TrimPrefix(instance.Name, "gpu-0-")
if name == "gpu-0" {
name = "whole"
}

partition := api.DevicePartition{
Name: instance.Name,
Name: name,
Attributes: attributesToDeviceAttributes(instance.Attributes, partitionAttrs),
}

Expand Down
Loading