Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7beaff8
update cambricon devices
archlitchi Mar 18, 2025
8d65a22
update
archlitchi Mar 19, 2025
de61013
Merge branch 'Project-HAMi:master' into master
archlitchi Mar 19, 2025
8d8fc41
Merge branch 'Project-HAMi:master' into master
archlitchi Apr 14, 2025
b3d462b
Merge branch 'Project-HAMi:master' into master
archlitchi Apr 21, 2025
dc5f6d3
Merge branch 'Project-HAMi:master' into master
archlitchi Apr 28, 2025
938ec7d
update
archlitchi Apr 28, 2025
c468ab2
update
archlitchi Apr 30, 2025
dec7c17
Merge branch 'Project-HAMi:master' into master
archlitchi Apr 30, 2025
5722345
update
archlitchi Apr 30, 2025
1b40386
Merge branch 'Project-HAMi:master' into master
archlitchi May 6, 2025
31a1e83
Merge branch 'Project-HAMi:master' into master
archlitchi May 21, 2025
82b7d4a
kunluncompat
archlitchi May 23, 2025
d9a56e5
update
archlitchi May 26, 2025
2a749b3
update
archlitchi May 26, 2025
2997156
update
archlitchi May 26, 2025
d0fa04d
Merge branch 'Project-HAMi:master' into master
archlitchi May 26, 2025
fffcfe9
update
archlitchi May 29, 2025
54a91f5
Merge branch 'master' of github.com:archlitchi/HAMi
archlitchi May 29, 2025
68ebcba
update
archlitchi May 30, 2025
1a53917
Merge branch 'Project-HAMi:master' into master
archlitchi May 30, 2025
aadd86d
update
archlitchi May 30, 2025
a2e7cd8
update ut
archlitchi May 30, 2025
e36f174
update
archlitchi Jun 3, 2025
a572487
update
archlitchi Jun 6, 2025
9e66a9b
update
archlitchi Jun 6, 2025
c12c7b4
Merge branch 'Project-HAMi:master' into master
archlitchi Jun 7, 2025
a901ece
update
archlitchi Jun 7, 2025
87c933d
Merge branch 'Project-HAMi:master' into master
archlitchi Jun 13, 2025
7bbdfd2
update
archlitchi Jun 13, 2025
66b780c
update
archlitchi Jun 13, 2025
1fc137d
update
archlitchi Jun 13, 2025
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
8 changes: 8 additions & 0 deletions charts/hami/templates/scheduler/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ data:
},
{{- end }}
{{- end }}
{{- if .Values.devices.kunlun.enabled }}
{{- range .Values.devices.kunlun.customresources }}
{
"name": "{{ . }}",
"ignoredByScheduler": true
},
{{- end }}
{{- end }}
{
"name": "{{ .Values.resourceName }}",
"ignoredByScheduler": true
Expand Down
6 changes: 6 additions & 0 deletions charts/hami/templates/scheduler/configmapnew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,10 @@ data:
ignoredByScheduler: true
{{- end }}
{{- end }}
{{- if .Values.devices.kunlun.enabled }}
{{- range .Values.devices.kunlun.customresources }}
- name: {{ . }}
ignoredByScheduler: true
{{- end }}
{{- end }}
{{- end }}
8 changes: 6 additions & 2 deletions charts/hami/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,17 @@ devicePlugin:
# memory: 100Mi

devices:
kunlun:
enabled: true
customresources:
- kunlunxin.com/xpu
enflame:
enabled: false
enabled: true
customresources:
- enflame.com/vgcu
- enflame.com/vgcu-percentage
mthreads:
enabled: false
enabled: true
customresources:
- mthreads.com/vgpu
nvidia:
Expand Down
5 changes: 4 additions & 1 deletion pkg/device/cambricon/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ func (dev *CambriconDevices) CheckHealth(devType string, n *corev1.Node) (bool,
func (dev *CambriconDevices) GetNodeDevices(n corev1.Node) ([]*util.DeviceInfo, error) {
nodedevices := []*util.DeviceInfo{}
i := 0
cards, _ := n.Status.Capacity.Name(corev1.ResourceName(MLUResourceCores), resource.DecimalSI).AsInt64()
cards, ok := n.Status.Capacity.Name(corev1.ResourceName(MLUResourceCores), resource.DecimalSI).AsInt64()
if !ok || cards == 0 {
return []*util.DeviceInfo{}, fmt.Errorf("device not found %s", MLUResourceCores)
}
memoryTotal, _ := n.Status.Capacity.Name(corev1.ResourceName(MLUResourceMemory), resource.DecimalSI).AsInt64()
for int64(i)*100 < cards {
nodedevices = append(nodedevices, &util.DeviceInfo{
Expand Down
2 changes: 1 addition & 1 deletion pkg/device/enflame/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (dev *EnflameDevices) GetNodeDevices(n corev1.Node) ([]*util.DeviceInfo, er
i := 0
cards, ok := n.Status.Capacity.Name(corev1.ResourceName(CountNoSharedName), resource.DecimalSI).AsInt64()
if !ok || cards == 0 {
return nodedevices, nil
return []*util.DeviceInfo{}, fmt.Errorf("device not found %s", CountNoSharedName)
}
shared, _ := n.Status.Capacity.Name(corev1.ResourceName(SharedResourceName), resource.DecimalSI).AsInt64()
dev.factor = int(shared / cards)
Expand Down
5 changes: 4 additions & 1 deletion pkg/device/iluvatar/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ func (dev *IluvatarDevices) MutateAdmission(ctr *corev1.Container, p *corev1.Pod
func (dev *IluvatarDevices) GetNodeDevices(n corev1.Node) ([]*util.DeviceInfo, error) {
nodedevices := []*util.DeviceInfo{}
i := 0
cards, _ := n.Status.Capacity.Name(corev1.ResourceName(IluvatarResourceCores), resource.DecimalSI).AsInt64()
cards, ok := n.Status.Capacity.Name(corev1.ResourceName(IluvatarResourceCores), resource.DecimalSI).AsInt64()
if !ok || cards == 0 {
return []*util.DeviceInfo{}, fmt.Errorf("device not found %s", IluvatarResourceCores)
}
memoryTotal, _ := n.Status.Capacity.Name(corev1.ResourceName(IluvatarResourceMemory), resource.DecimalSI).AsInt64()
for int64(i)*100 < cards {
nodedevices = append(nodedevices, &util.DeviceInfo{
Expand Down
Loading