diff --git a/06_gpu_and_ml/torch_profiling.py b/06_gpu_and_ml/torch_profiling.py index 9cb2efed4..e60a0bc99 100644 --- a/06_gpu_and_ml/torch_profiling.py +++ b/06_gpu_and_ml/torch_profiling.py @@ -82,13 +82,13 @@ def underutilize(scale=1): scale * 100, scale * 100, device="cuda" ) - class Record: # 🐌 1: creating a Python object in the hot loop - def __init__(self, value): - self.value = value - for ii in range(10): x = x @ x + class Record: # 🐌 1: heavy Python work in the hot loop + def __init__(self, value): + self.value = value + records.append(Record(ii)) x[0][0].cpu() # force a host sync for accurate timing