Spaces:
Running on Zero
Running on Zero
correct the empty_cache comment: autograd was the OOM
Browse files
app.py
CHANGED
|
@@ -262,12 +262,11 @@ def run(world: str, steer_to: str, steer_at: float, seconds: float, seed: int):
|
|
| 262 |
|
| 263 |
t0 = time.perf_counter()
|
| 264 |
engine.start(world=WORLDS[world], seed=int(seed))
|
| 265 |
-
# Opening a world decodes all 81 of its pixel frames in one call,
|
| 266 |
-
#
|
| 267 |
-
#
|
| 268 |
-
#
|
| 269 |
-
#
|
| 270 |
-
# the run dies on an internal assert instead. Hand the cache back first.
|
| 271 |
torch.cuda.empty_cache()
|
| 272 |
torch.cuda.reset_peak_memory_stats()
|
| 273 |
frames, pending_steer, last_push = [], steer_idx is not None, 0.0
|
|
|
|
| 262 |
|
| 263 |
t0 = time.perf_counter()
|
| 264 |
engine.start(world=WORLDS[world], seed=int(seed))
|
| 265 |
+
# Opening a world decodes all 81 of its pixel frames in one call, the largest
|
| 266 |
+
# allocation in a run, and leaves the allocator holding ~17 GB the block loop has
|
| 267 |
+
# no use for (reserved 30.5 G against 13.5 G allocated). Handing it back is not
|
| 268 |
+
# what fixed the OOM this Space started with -- that was autograd, see
|
| 269 |
+
# `harden_worker` -- but there is no reason to sit on it either.
|
|
|
|
| 270 |
torch.cuda.empty_cache()
|
| 271 |
torch.cuda.reset_peak_memory_stats()
|
| 272 |
frames, pending_steer, last_push = [], steer_idx is not None, 0.0
|