JonathanColetti commited on
Commit
b32da83
·
verified ·
1 Parent(s): 07d89ca

correct the empty_cache comment: autograd was the OOM

Browse files
Files changed (1) hide show
  1. app.py +5 -6
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, which is by far
266
- # the largest allocation in a run and leaves the caching allocator holding blocks
267
- # the block loop cannot reuse (reserved 30.5 G against 13.5 G allocated). Growing
268
- # past that OOMs, and a ZeroGPU worker cannot even format the OOM message --
269
- # PyTorch asks NVML which processes hold memory, NVML is not available there, and
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