停止所有GPU监控并返回结果
(self)
| 282 | return results |
| 283 | |
| 284 | def stop_all(self): |
| 285 | """停止所有GPU监控并返回结果""" |
| 286 | results = {} |
| 287 | max_peak = 0.0 |
| 288 | for monitor in self.monitors: |
| 289 | peak = monitor.stop() |
| 290 | results[monitor.gpu_index] = { |
| 291 | 'name': monitor.gpu_name, |
| 292 | 'peak_memory': peak, |
| 293 | 'unit': monitor.unit |
| 294 | } |
| 295 | if peak > max_peak: |
| 296 | max_peak = peak |
| 297 | return results, max_peak |
| 298 | |
| 299 | def stop_all_and_get_max(self): |
| 300 | """停止所有监控并返回最大峰值""" |
no test coverage detected