Repository navigation
Default delayed couplings to the circular history buffer - #22
Merged
Merged
Conversation
… for delay coupling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delayed couplings now default to
buffer_strategy="circular"instead of"roll". Roll shifts the whole buffer every step (and again in the gradient); circular only advances a write pointer, so per-step cost is independent of buffer length. It is faster in most forward and gradient workloads, clearly so on GPU and for long buffers, and about neutral on CPU. Simulation results are unchanged.Changes
DelayedCoupling.__init__defaults to"circular"(coupling/base.py); docstring updated.SigmoidCoupling,TanhCoupling,DelayedSigmoidCouplingandPrePostCouplingare exported fromtvboptim.experimental.network_dynamics.coupling.docs/advanced/buffer_strategies.qmdupdated for the new default.ParallelExecutiongets a per-device recipe (host devices viaXLA_FLAGSwithn_vmap=1on CPU,n_vmapbatching on GPU).Behaviour change
The default coupling state gains an integer
write_idxleaf, so states, configs and pickles saved under the old default no longer match the tree structure. Re-prepare, or passbuffer_strategy="roll". During a run the raw history is a ring indexed fromwrite_idx, not oldest to newest.