Repository navigation
Conversation
If `f` threw while a config tape was recording, the tape stayed recording with stale nodes: later calls appended to them and a `deepcopy` of the config gave zero gradients again (#337). If the reverse pass threw, the tape stayed finished and the config could not record anymore. `record_finished!` reopens an idle tape, records and finishes it, and makes it idle again if recording throws; `gradient` and `jacobian` make the tape idle in a `finally`. Tapes that hold a recording are still left alone. Also adds a test for the in-place Jacobian with tuple inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #339 +/- ##
==========================================
+ Coverage 94.77% 95.30% +0.53%
==========================================
Files 19 19
Lines 1721 1724 +3
==========================================
+ Hits 1631 1643 +12
+ Misses 90 81 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Follow-up to #338. If
fthrew while a config tape was recording, the tape stayed recording with partial instructions: later calls with the config appended to them (wrong derivatives) and adeepcopyof the config gave zero gradients again (#337). If the reverse pass threw, e.g. in a custom@gradpullback, the tape stayed finished and the config could not be used anymore.record_finished!replacesreopen!: it reopens an idle tape, records and finishes it, and makes the tape idle again if recording throws. Tapes holding a recording are still left alone.gradient,gradient!,jacobianandjacobian!make the config tape idle in afinally;HessianTapedoes the same for its intermediate gradient tape.🤖 Generated with Claude Code