Skip to content

Stream privacy-safe progress logging from long-running steps - #56

Merged
florian6973 merged 1 commit into
mainfrom
progress-logging
Nov 29, 2026
Merged

florian6973 merged 1 commit into
mainfrom
progress-logging

Conversation

@florian6973

Copy link
Copy Markdown
Collaborator

Why

Generated algorithms print nothing while they train. A long SLURM step, such as Curiosity's pretraining at about 20 h, can't be told apart from a hung one by its log; you have to attach to the job and run nvidia-smi.

What

  • Generated CLI (__main__.py): configures logging to stderr just before running a step: INFO by default, overridable with LOG_LEVEL, one flushed line per record. Core already sends a step's stdout and stderr to logs/<step>.log and the SLURM output files as they're written, so progress now appears while the step runs. A print to a file would be block-buffered. profiles and commands output is unchanged.
  • Implementation guide: a new subsection, "Progress logging", in section 4.
    • What long steps must log: phases with planned sizes; step or epoch out of the total with training loss, learning rate and throughput; tuning evaluations and the kept checkpoint; inference and generation counts.
    • That logs must never reveal patient-level data: aggregates and configuration only. Never subject IDs, prediction times or dates, code or event sequences, values, labels or predictions of a subject, generated trajectories, sample rows, or code names or vocabulary entries (a rare code can identify a patient in a small cohort). Exceptions that embed such values must be avoided. Logs are treated as shareable, because they leave clusters and appear in CI output.
  • AGENTS.md: a one-bullet summary.
  • Test: the rendered-lifecycle test logs from train_supervised and checks that the INFO <module>: … line reaches the step's output.

Checks

  • ruff check and ruff format --check pass.
  • pytest -q: 87 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx

Generated algorithms printed nothing while training, so a long SLURM
step (Curiosity's pretraining, about 20 h) could not be told apart from
a hung one from its log.

- The generated CLI configures logging to stderr before running a step:
  INFO by default (LOG_LEVEL overrides), one flushed line per record, so
  progress reaches logs/<step>.log and the SLURM output while running
  (print to a file is block-buffered).
- The implementation guide gains "Progress logging": what long steps
  must log (phases with planned sizes, step/epoch out of total, training
  and tuning loss, kept checkpoint, inference counts) and that logs carry
  only aggregates and configuration, never subject IDs, times, codes,
  values, labels, predictions, trajectories or sample rows.
- AGENTS.md summarises the rule.
- The rendered-lifecycle test checks a step's logger.info line reaches
  its output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant