Spaces:
Running
on
Zero
Running
on
Zero
Fix timelog
Browse files- spaces/zero/wrappers.py +4 -4
spaces/zero/wrappers.py
CHANGED
|
@@ -132,19 +132,19 @@ def worker_init(
|
|
| 132 |
progress.update(round(current_progress * 100) - progress.n)
|
| 133 |
t0 = time.perf_counter()
|
| 134 |
client.allow(allow_token)
|
| 135 |
-
print("client.allow", (dt := time.perf_counter() - t0)); t0
|
| 136 |
update(SPAWN_PROGRESS_CLEANUP)
|
| 137 |
torch.unpatch()
|
| 138 |
-
print("torch.unpatch", (dt := time.perf_counter() - t0)); t0
|
| 139 |
torch.init(nvidia_uuid)
|
| 140 |
-
print("torch.init", (dt := time.perf_counter() - t0)); t0
|
| 141 |
update(SPAWN_PROGRESS_INIT)
|
| 142 |
callback = None
|
| 143 |
if (transfer_size := torch.size()) > 0:
|
| 144 |
remaining = 1 - (SPAWN_PROGRESS_CLEANUP + SPAWN_PROGRESS_INIT)
|
| 145 |
callback = lambda n: update(n * remaining / transfer_size)
|
| 146 |
torch.move(callback=callback)
|
| 147 |
-
print("torch.move", (dt := time.perf_counter() - t0)); t0
|
| 148 |
except Exception as e: # pragma: no cover
|
| 149 |
traceback.print_exc()
|
| 150 |
return ExceptionResult(e)
|
|
|
|
| 132 |
progress.update(round(current_progress * 100) - progress.n)
|
| 133 |
t0 = time.perf_counter()
|
| 134 |
client.allow(allow_token)
|
| 135 |
+
print("client.allow", (dt := time.perf_counter() - t0)); t0 += dt
|
| 136 |
update(SPAWN_PROGRESS_CLEANUP)
|
| 137 |
torch.unpatch()
|
| 138 |
+
print("torch.unpatch", (dt := time.perf_counter() - t0)); t0 += dt
|
| 139 |
torch.init(nvidia_uuid)
|
| 140 |
+
print("torch.init", (dt := time.perf_counter() - t0)); t0 += dt
|
| 141 |
update(SPAWN_PROGRESS_INIT)
|
| 142 |
callback = None
|
| 143 |
if (transfer_size := torch.size()) > 0:
|
| 144 |
remaining = 1 - (SPAWN_PROGRESS_CLEANUP + SPAWN_PROGRESS_INIT)
|
| 145 |
callback = lambda n: update(n * remaining / transfer_size)
|
| 146 |
torch.move(callback=callback)
|
| 147 |
+
print("torch.move", (dt := time.perf_counter() - t0)); t0 += dt
|
| 148 |
except Exception as e: # pragma: no cover
|
| 149 |
traceback.print_exc()
|
| 150 |
return ExceptionResult(e)
|