Skip to content

Advance every training clock the compiled function reads - #105

Merged
jessegrabowski merged 2 commits into
pymc-devs:mainfrom
jessegrabowski:advance-clocks-in-function
Aug 24, 2026
Merged

Advance every training clock the compiled function reads#105
jessegrabowski merged 2 commits into
pymc-devs:mainfrom
jessegrabowski:advance-clocks-in-function

Conversation

@jessegrabowski

@jessegrabowski jessegrabowski commented Aug 24, 2026

Copy link
Copy Markdown
Member

A schedule places itself in time by reading a StepCounter, but nothing advanced that counter unless the training step came from compile_train. Build the updates yourself and compile with function and the clock sat at zero, so the schedule returned its initial rate on every call -- under a warmup that rate is zero, and the network never moved while reporting a flat loss.

function now threads the one-step advance for every clock the graph reads, alongside the RNG updates it already threads. A caller's own updates entry still wins, which is how a clock gets pinned, and a pinned clock is exempt from the check that every clock agrees on its step count -- it isn't counting these steps, so it has nothing to agree with.

Closes #79
Closes #106

A clock is read by the update expressions a schedule feeds rather than by the outputs, so collecting from the outputs alone left it at zero and pinned every schedule to its initial rate, which under a warmup is exactly zero.

Closes pymc-devs#79
@codecov-commenter

codecov-commenter commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (559cfc8) to head (db79d07).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage   97.47%   97.47%           
=======================================
  Files          60       60           
  Lines        3011     3012    +1     
=======================================
+ Hits         2935     2936    +1     
  Misses         76       76           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jessegrabowski
jessegrabowski merged commit c1afd79 into pymc-devs:main Aug 24, 2026
10 checks passed
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.

function() rejects mismatched clocks even when the caller pinned them all A clock nothing advances compiles silently, pinning the schedule at step 0

2 participants