-
Notifications
You must be signed in to change notification settings - Fork 61
ENH Dealing with skops persistence protocol updates #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adrinjalali
merged 9 commits into
skops-dev:main
from
BenjaminBossan:POC-updating-skops-persistence-protocol
Mar 22, 2023
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6a36dcc
POC: Proposal for how to deal with protocol update
BenjaminBossan 35280e7
Fixing black
BenjaminBossan b535d9a
Check in missing module file
BenjaminBossan b58f169
Check in even more missing stuff
BenjaminBossan 8852480
Upgrade protocol to use new FunctionNode
BenjaminBossan e1e891a
Merge branch 'main' into POC-updating-skops-persistence-protocol
BenjaminBossan b0f83fa
Fix annotation issue, add missing file
BenjaminBossan 1e9415e
Give an example for downgrade_state
BenjaminBossan 333f9d1
Add test for perstisting functions
BenjaminBossan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| """The current protocol of the skops version | ||
|
|
||
| Notes on updating the protocol: | ||
|
|
||
| Every time that a backwards incompatible change to the skops format is made | ||
| for the first time within a release, the protocol should be bumped to the next | ||
| higher number. The old version of the Node, which knows how to deal with the | ||
| old state, should be preserved, registered, and tested. Let's give an example: | ||
|
|
||
| - There is a BC breaking change in FunctionNode. | ||
| - Since it's the first BC breaking change in the skops format in this release, | ||
| bump skops.io._protocol.PROTOCOL (this file) from version X to X+1. | ||
| - Move the old FunctionNode code into 'skops/io/old/_general_vX.py', where 'X' | ||
| is the old protocol. | ||
| - Register the _general_vX.FunctionNode in NODE_TYPE_MAPPING inside of | ||
| _persist.py. | ||
| - Write a test in test_persist_old.py that shows that the old state can | ||
| still be loaded. Look at test_persist_old.test_function_v0 for inspiration. | ||
|
|
||
| Now, if a user loads a FunctionNode state with version X using skops with | ||
| version Y>X, the old code will be used instead of the new one. For all other | ||
| node types, if there is no loader for version X, skops will automatically use | ||
| version Y instead. | ||
|
|
||
| """ | ||
| PROTOCOL = 1 |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.