Skip to content

Commit

Permalink
use add for watermark accumulator
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Puller <[email protected]>
  • Loading branch information
zpuller committed Sep 17, 2024
1 parent fecf8a7 commit 4697e40
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ class WatermarkAccumulator extends AccumulatorV2[jl.Long, Long] {
_value += v
}

def setMaxIfGreater(v: Long): Unit = {
_value = _value.max(v)
}

override def merge(other: AccumulatorV2[jl.Long, Long]): Unit = other match {
case wa: WatermarkAccumulator =>
_value = _value.max(wa._value)
Expand Down Expand Up @@ -216,7 +212,7 @@ class GpuTaskMetrics extends Serializable {
def updateMaxMemory(taskAttemptId: Long): Unit = {
val maxMem = RmmSpark.getAndResetMaxMemoryAllocated(taskAttemptId)
if (maxMem > 0) {
maxDeviceMemoryBytes.setMaxIfGreater(maxMem)
maxDeviceMemoryBytes.add(maxMem)
}
}
}
Expand Down

0 comments on commit 4697e40

Please sign in to comment.