Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions GPU-Virtual-Service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ spec:
- containerPort: 8000
resources:
requests: # vgpu资源配置
huawei.com/vgpu-number: 1
huawei.com/vgpu-cores: 20
huawei.com/vgpu-memory.1Gi: 3
flexai.com/vgpu-number: 1
flexai.com/vgpu-cores: 20
flexai.com/vgpu-memory.1Gi: 3
limits:
huawei.com/vgpu-number: 1
huawei.com/vgpu-cores: 20
huawei.com/vgpu-memory.1Gi: 3
flexai.com/vgpu-number: 1
flexai.com/vgpu-cores: 20
flexai.com/vgpu-memory.1Gi: 3
volumeMounts:
- name: local-models
mountPath: {path/to/DeepSeek-R1-Distill-llama-8B-main} # 填写模型权重路径
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"google.golang.org/grpc"

"huawei.com/vxpu-device-plugin/pkg/api/runtime/service"
"huawei.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/api/runtime/service"
"flexai.com/vxpu-device-plugin/pkg/log"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"github.com/fsnotify/fsnotify"
"k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"

"huawei.com/vxpu-device-plugin/pkg/api/runtime/service"
"huawei.com/vxpu-device-plugin/pkg/log"
"huawei.com/vxpu-device-plugin/pkg/plugin"
"huawei.com/vxpu-device-plugin/pkg/plugin/config"
"huawei.com/vxpu-device-plugin/pkg/plugin/xpu"
"huawei.com/vxpu-device-plugin/watchers"
"flexai.com/vxpu-device-plugin/pkg/api/runtime/service"
"flexai.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/plugin"
"flexai.com/vxpu-device-plugin/pkg/plugin/config"
"flexai.com/vxpu-device-plugin/pkg/plugin/xpu"
"flexai.com/vxpu-device-plugin/watchers"
)

const (
Expand Down Expand Up @@ -139,7 +139,7 @@ func main() {
flag.StringVar(&config.NodeName, "node-name", os.Getenv("NODE_NAME"), "node name")
// 日志目录:日志文件的存储目录
flag.StringVar(&config.LogDir, "log-dir", defaultLogDir, "log storage directory")
// 资源名称:Kubernetes 中的资源名称,用于向 kubelet 注册(如 "huawei.com/gpu")
// 资源名称:Kubernetes 中的资源名称,用于向 kubelet 注册(如 "flexai.com/gpu")
flag.StringVar(&resourceName, "resource-name", xpu.VxpuNumber, "resource name")
// GPU 类型配置文件:GPU 类型配置文件的绝对路径
flag.StringVar(&config.GPUTypeConfig, "gpu-type-config", "", "the abs path map of gpu type config file")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
command: ["bash", "-c", "sleep 86400"]
resources:
limits:
huawei.com/vgpu-number: 1 # requesting 1 vGPU
huawei.com/vgpu-memory.1Gi: 6
# huawei.com/vgpu-cores: 80
flexai.com/vgpu-number: 1 # requesting 1 vGPU
flexai.com/vgpu-memory.1Gi: 6
# flexai.com/vgpu-cores: 80
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ spec:
command: ["bash", "-c", "sleep 86400"]
resources:
limits:
huawei.com/vgpu-number: 1 # requesting 1 vGPU
huawei.com/vgpu-memory.1Gi:1
huawei.com/vgpu-cores: 25 # percentage: 50 Each vGPU containers 50% device memory of that GPU. Can not be used with nvidia/gpumem
flexai.com/vgpu-number: 1 # requesting 1 vGPU
flexai.com/vgpu-memory.1Gi:1
flexai.com/vgpu-cores: 25 # percentage: 50 Each vGPU containers 50% device memory of that GPU. Can not be used with nvidia/gpumem
- name: ubuntu-container0
image: docker.io/nvidia/cuda:11.0.3-base-ubuntu18.04
command: ["bash", "-c", "sleep 86400"]
Expand All @@ -21,5 +21,5 @@ spec:
command: ["bash", "-c", "sleep 86400"]
resources:
limits:
huawei.com/vgpu-number: 1 # requesting 1 vGPU
huawei.com/vgpu-memory.1Gi:1
flexai.com/vgpu-number: 1 # requesting 1 vGPU
flexai.com/vgpu-memory.1Gi:1
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ spec:
command: ["bash", "-c", "sleep 86400"]
resources:
limits:
huawei.com/vgpu-number: 1 # requesting 1 vGPU
flexai.com/vgpu-number: 1 # requesting 1 vGPU
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module huawei.com/vxpu-device-plugin
module flexai.com/vxpu-device-plugin

go 1.22.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"time"

"google.golang.org/grpc"
"huawei.com/vxpu-device-plugin/pkg/log"
"huawei.com/vxpu-device-plugin/pkg/plugin/config"
"huawei.com/vxpu-device-plugin/pkg/plugin/types"
"huawei.com/vxpu-device-plugin/pkg/plugin/util"
"huawei.com/vxpu-device-plugin/pkg/plugin/xpu"
"flexai.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/plugin/config"
"flexai.com/vxpu-device-plugin/pkg/plugin/types"
"flexai.com/vxpu-device-plugin/pkg/plugin/util"
"flexai.com/vxpu-device-plugin/pkg/plugin/xpu"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"huawei.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/log"
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"

"huawei.com/vxpu-device-plugin/pkg/plugin/xpu"
"flexai.com/vxpu-device-plugin/pkg/plugin/xpu"
)

// DeviceCache provide xpu device cache for plugin and register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"google.golang.org/grpc"
"k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"

"huawei.com/vxpu-device-plugin/pkg/lock"
"huawei.com/vxpu-device-plugin/pkg/log"
"huawei.com/vxpu-device-plugin/pkg/plugin/config"
"huawei.com/vxpu-device-plugin/pkg/plugin/types"
"huawei.com/vxpu-device-plugin/pkg/plugin/util"
"huawei.com/vxpu-device-plugin/pkg/plugin/xpu"
"flexai.com/vxpu-device-plugin/pkg/lock"
"flexai.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/plugin/config"
"flexai.com/vxpu-device-plugin/pkg/plugin/types"
"flexai.com/vxpu-device-plugin/pkg/plugin/util"
"flexai.com/vxpu-device-plugin/pkg/plugin/xpu"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (

"gopkg.in/yaml.v2"

"huawei.com/vxpu-device-plugin/pkg/graph"
"huawei.com/vxpu-device-plugin/pkg/log"
"huawei.com/vxpu-device-plugin/pkg/plugin/config"
"huawei.com/vxpu-device-plugin/pkg/plugin/types"
"huawei.com/vxpu-device-plugin/pkg/plugin/util"
"huawei.com/vxpu-device-plugin/pkg/plugin/xpu"
"flexai.com/vxpu-device-plugin/pkg/graph"
"flexai.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/plugin/config"
"flexai.com/vxpu-device-plugin/pkg/plugin/types"
"flexai.com/vxpu-device-plugin/pkg/plugin/util"
"flexai.com/vxpu-device-plugin/pkg/plugin/xpu"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package types

const (
// DeviceBindTime allocate bind time
DeviceBindTime = "huawei.com/bind-time"
DeviceBindTime = "flexai.com/bind-time"
// DeviceBindPhase allocate bind phase
DeviceBindPhase = "huawei.com/bind-phase"
DeviceBindPhase = "flexai.com/bind-phase"

// DeviceBindAllocating bind phase allocating
DeviceBindAllocating = "allocating"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"k8s.io/apimachinery/pkg/fields"
k8stypes "k8s.io/apimachinery/pkg/types"

"huawei.com/vxpu-device-plugin/pkg/lock"
"huawei.com/vxpu-device-plugin/pkg/log"
"huawei.com/vxpu-device-plugin/pkg/plugin/config"
"huawei.com/vxpu-device-plugin/pkg/plugin/types"
"huawei.com/vxpu-device-plugin/pkg/plugin/xpu"
"flexai.com/vxpu-device-plugin/pkg/lock"
"flexai.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/plugin/config"
"flexai.com/vxpu-device-plugin/pkg/plugin/types"
"flexai.com/vxpu-device-plugin/pkg/plugin/xpu"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ import (

"k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"

"huawei.com/vxpu-device-plugin/pkg/gonvml"
"huawei.com/vxpu-device-plugin/pkg/graph"
"huawei.com/vxpu-device-plugin/pkg/log"
"huawei.com/vxpu-device-plugin/pkg/plugin/config"
"huawei.com/vxpu-device-plugin/pkg/plugin/types"
"flexai.com/vxpu-device-plugin/pkg/gonvml"
"flexai.com/vxpu-device-plugin/pkg/graph"
"flexai.com/vxpu-device-plugin/pkg/log"
"flexai.com/vxpu-device-plugin/pkg/plugin/config"
"flexai.com/vxpu-device-plugin/pkg/plugin/types"
)

const (
// VxpuNumber vxpu number resource name
VxpuNumber = "huawei.com/vgpu-number"
VxpuNumber = "flexai.com/vgpu-number"
// VxpuCore vxpu core resource name
VxpuCore = "huawei.com/vgpu-cores"
VxpuCore = "flexai.com/vgpu-cores"
// VxpuMemory vxpu memory resource name
VxpuMemory = "huawei.com/vgpu-memory.1Gi"
VxpuMemory = "flexai.com/vgpu-memory.1Gi"
microSecond = 1000 * 1000
milliwatts = 1000
eventWaitTimeout = 5000
Expand All @@ -45,15 +45,15 @@ const (
VxpuIdsConfigFileName = "vgpu-ids.config"
// DeviceAssign device type supported by the device plugin
DeviceType = "GPU"
AssignedIDs = "huawei.com/vgpu-ids-new"
AssignedIDsToAllocate = "huawei.com/vgpu-devices-to-allocate"
NodeVXPUHandshake = "huawei.com/node-vgpu-handshake"
NodeVXPURegister = "huawei.com/node-vgpu-register"
NodeVXPUUsed = "huawei.com/node-vgpu-used"
AssignedIDs = "flexai.com/vgpu-ids-new"
AssignedIDsToAllocate = "flexai.com/vgpu-devices-to-allocate"
NodeVXPUHandshake = "flexai.com/node-vgpu-handshake"
NodeVXPURegister = "flexai.com/node-vgpu-register"
NodeVXPUUsed = "flexai.com/node-vgpu-used"
// AssignedNode assigned node name
AssignedNode = "huawei.com/vgpu-node"
AssignedNode = "flexai.com/vgpu-node"
// NodeXpuTopology node gpu topology
NodeXpuTopology = "huawei.com/node-gpu-topology"
NodeXpuTopology = "flexai.com/node-gpu-topology"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions GPU-Virtual-Service/xpu-pool-service/install/gpu_env_init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Copyright (C) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.

set -e

Expand Down Expand Up @@ -27,4 +28,4 @@ else
exit 1
fi

kubectl label node ${host_name} huawei.com/vgpu=ready
kubectl label node ${host_name} flexai.com/vgpu=ready
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (C) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.

apiVersion: v2
name: gpupool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (C) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.

Thank you for installing {{ .Chart.Name }}.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright Huawei Technologies Co., Ltd. 2024-2025. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Copyright Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.gpuDevicePlugin.name }}-configmap
namespace: {{ .Values.basic.namespace }}
data:
gpu-type.conf: |
# Copyright Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
{{ range $key, $value := .Values.gpuTypeMap }}
{{ $key }}: {{ $value }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright Huawei Technologies Co., Ltd. 2024-2025. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (C) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (C) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.

apiVersion: v1
kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright Huawei Technologies Co., Ltd. 2024-2025. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
apiVersion: v1
kind: Service
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.
{{- if .Values.ServiceMonitor.enable }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Copyright (C) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.

basic:
swr_addr: "docker.io/library"
namespace: xpu

gpu:
nodeSelector:
huawei.com/vgpu: ready
flexai.com/vgpu: ready
npu:
nodeSelector:
huawei.com/vnpu: ready
flexai.com/vnpu: ready

gpuDevicePlugin:
name: gpu-device-plugin
Expand Down
3 changes: 2 additions & 1 deletion GPU-Virtual-Service/xpu-pool-service/install/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Copyright (C) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
# Copyright (c) 2025 Shanghai Jiao Tong University.
# Contributed to the ModelEngine Community.

set -e

Expand Down
Loading
Loading