diag(vf): say where the value functions trained, and how big they are

"Training is slow" and "training is slow ON THE CPU with four million
parameters" are different problems with different fixes, and nothing in the log
told them apart — leaving it to be inferred from timings, which is how the
first guess at this went to the disk instead.

One line per run per value function, naming the device and the parameter count.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-08-25 14:34:26 +03:00
co-authored by Claude Opus 5
parent 8cdee7072f
commit 33227b198d
3 changed files with 39 additions and 0 deletions
+5
View File
@@ -41,6 +41,10 @@ class OnlineValueFunction(nn.Module):
)
self.nets = nn.ModuleList([_make_net() for _ in range(self.ENSEMBLE_SIZE)])
# Where the last train_on actually ran. Reported once per run: "training is slow" and
# "training is slow ON THE CPU" are different problems, and nothing else in the log
# distinguishes them.
self.last_train_device = None
self._optimizer = None
self.buffer_c = [] # compressed conditioning tensors [hidden_dim]
self.buffer_r = [] # reward floats
@@ -130,6 +134,7 @@ class OnlineValueFunction(nn.Module):
# rebuilt lazily and never persisted, so a run starts from fresh moments
# either way.
self._optimizer = None
self.last_train_device = str(device)
try:
self._train_steps(device)
finally: