CostlyOstrich36 I made a code snippet for you:
` from clearml import Task
figuring out the project ID
project_list = Task.get_projects() # get all the projects
project_id = Task.get_project_id("your project name here")
getting all the tasks for a project
tasks = Task.get_all(project=[project_id]).response.tasks
loop through and get approximate maximum gpu-seconds by type.
import random
from collections import defaultdict
task = random.choice(tasks)
print(dir(task))
print(task.runtime)
gpu_seconds = defaultdict(int)
for task in tasks:
if task.runtime.get("gpu_count", 0) >0:
gpu_type = task.runtime.get("gpu_type")
active_duration = task.active_duration # in seconds, according to
print(f"active_duration of {gpu_type} is {active_duration} seconds")
gpu_seconds[gpu_type] = gpu_seconds[gpu_type] + active_duration Result of printing gpu_hours now will look like
defaultdict(int,
{'A100-PCIE-40GB': 3563829,
'GeForce RTX 2080 Ti': 119211,
'Quadro P5200': 80997,
'TITAN RTX': 484239,
'Tesla P100-PCIE-16GB': 99454,
'Tesla T4': 193,
'Tesla V100-SXM2-16GB': 1278}) `