Skip to content

Commit 1eeb306

Browse files
committed
fix: gpu node raw cost metrics wrong bug
1 parent 09eb7de commit 1eeb306

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

config/samples/gpu-info-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@
99
vendor: NVIDIA
1010
costPerHour: 1.89
1111
fp16TFlops: 312
12+
13+
- model: NVIDIA 3090
14+
fullModelName: "NVIDIA GeForce RTX 3090"
15+
vendor: NVIDIA
16+
costPerHour: 0.3
17+
fp16TFlops: 71.2
18+
19+
- model: NVIDIA 5060 Ti
20+
fullModelName: "NVIDIA GeForce RTX 5060 Ti"
21+
vendor: NVIDIA
22+
costPerHour: 0.25
23+
fp16TFlops: 66

internal/metrics/recorder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ func (mr *MetricsRecorder) getWorkerRawCost(metrics *WorkerResourceMetrics, dura
371371
func (mr *MetricsRecorder) getNodeRawCost(metrics *NodeResourceMetrics, duration time.Duration, hourlyUnitPriceMap map[string]float64) float64 {
372372
cost := 0.0
373373
for _, gpuModel := range metrics.gpuModels {
374-
cost += metrics.AllocatedTflops * duration.Hours() * hourlyUnitPriceMap[gpuModel]
374+
cost += duration.Seconds() * hourlyUnitPriceMap[gpuModel] / 3600.0
375375
}
376376
return cost
377377
}

0 commit comments

Comments
 (0)