Skip to content

Commit

Permalink
Report the gpu model in stats handle
Browse files Browse the repository at this point in the history
  • Loading branch information
hugy718 committed Jan 3, 2024
1 parent 32bdf4f commit 75fd9d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions task_executor/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ type ResourceStats struct {
TaskMEM int `json:"task_mem"` // MB
TaskUsedCPU float64 `json:"task_used_cpu"` // %
TaskUsedMEM float64 `json:"task_used_mem"` // %
GPUModel string `json:"gpu_model"`
TaskGPU int `json:"task_gpu"` // count
TaskUsedGPU int `json:"task_used_gpu"` // count
}
Expand Down Expand Up @@ -413,6 +414,7 @@ func (m *resourceManager) Stats() (stats ResourceStats) {
stats.TaskMEM = int(m.taskTotalMEM)
stats.TaskUsedCPU = 100 - 100*float64(m.taskAvailCPU.Load())/float64(m.taskTotalCPU)
stats.TaskUsedMEM = 100 - 100*float64(m.taskAvailMEM.Load())/float64(m.taskTotalMEM)
stats.GPUModel = m.monitor.GetGPUModel()
stats.TaskGPU = m.monitor.GetGPUCount()
stats.TaskUsedGPU = len(m.gpuAvail)
return
Expand Down

0 comments on commit 75fd9d1

Please sign in to comment.