You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RFC-0017-PyTorch-Operator-Versioning.md
+6-14Lines changed: 6 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@ These operators sometimes require changes to maintain the high quality user expe
7
7
8
8
BC and FC breaking changes have been challenging to coordinate across PyTorch because there are multiple consumers of PyTorch’s op set and we promise to keep models running in production working as expected.
9
9
10
-
We are providing the same Service Level Agreement (SLA) to both internal and external use cases, which is included in the goals to be finalized.
11
-
12
10
This document proposes a new BC and FC policy based on operator versioning.
13
11
12
+
Moving forward, we're not having a difference between Meta internal and Open Source (OSS) guarantees. They would be moving under *the same Service Level Agreement (SLA)* to both internal and external use cases.
13
+
14
14
15
15
## History
16
16
@@ -21,10 +21,8 @@ Backwards compatibility (BC), the ability for PyTorch to continue running progra
21
21
22
22
PyTorch current SLA on backwards compatibility:
23
23
24
-
25
-
26
-
***OSS** — “stable” features will be deprecated for one release before a BC-breaking change is made. [PyTorch OSS BC-breaking policy](https://pytorch.org/docs/master/)
27
-
***FB Internal** — we will not break a serialized torchscript program running in production at Facebook (to be replaced with a more generic SLA)
24
+
***OSS** — “stable” features will be deprecated for one release before a BC-breaking change is made. [PyTorch OSS BC-breaking policy](https://pytorch.org/docs/master/)
25
+
***Meta Internal** — we will not break a serialized torchscript program running in production at Meta (to be replaced with a more generic SLA)
28
26
29
27
BC-breaking operator changes were previously governed by the [Backward-compatibility Breaking Change Review Process](https://fb.quip.com/gydOArylrcKd), but this only covered torchscript and eager. A generic process needs to be visible from OSS.
30
28
@@ -38,7 +36,7 @@ PyTorch current SLA on forward compatibility:
38
36
39
37
40
38
***OSS** — no promise
41
-
***FB Internal** — PyTorch commits can run existing PyTorch eager, package/deploy, and serialized torchscript programs for at least two weeks
39
+
***Meta Internal** — PyTorch commits can run existing PyTorch eager, package/deploy, and serialized torchscript programs for at least two weeks
42
40
* The addition of a new kwarg-only argument at the end of an op’s parameter list (but before out=, if present) with a default value is FC-compatible for serialized [torchscript](https://fb.workplace.com/groups/pytorch.dev/permalink/909079013003913/) and [mobile](https://fb.workplace.com/groups/pytorch.dev/permalink/912379562673858/).
43
41
44
42
@@ -100,7 +98,6 @@ We propose the operator versioning that works across eager, TorchScript, torch.p
100
98
* The operator version and upgraders are built into the runtime for BC.
101
99
* Allow for the addition of optional keyword-only arguments without a version bump or FC concern
102
100
* Since additional operators can be introduced in upgraders, tracing based selective build should also cover upgraders: easier for BC because the new runtimes goes with the upgraders.
103
-
* We should also consider the timeline for mobile to no longer use upgraders by requiring models that are too old update themselves before deployment (SLA time window).
104
101
***torch.package changes**
105
102
* Each torch.package package contains a table of operators and corresponding version according to PyTorch build used to package the model
106
103
* Q: How does the torch.package scenario for mapping old versions to current PyTorch operators work?
@@ -111,7 +108,7 @@ We propose the operator versioning that works across eager, TorchScript, torch.p
111
108
* e2e FC-breaking guide
112
109
* It’s OK to add new optional keyword-only arguments as long as their default semantic preserve the operator’s current semantics
113
110
***SLA window**
114
-
*We are targeting at a certain period length of Service-level agreement. May start from a window of two binary releases (longer than 90 days)
111
+
*PyTorch SLA will ensure that models developed using a certain version and developed with non-deprecated APIs, will be runnable (with a slight performance regression allowed) for *up to one more release or 180 days* (from the version release date that introduced the BC-breaking change), whichever is later.
115
112
116
113
Note that the proposal does not introduce an explicit version to _all_ PyTorch operators. Instead code changes are only required for updated operators with BC/FC breakage, that cannot be handled by automatic BC/FC methods. For other operators, the implicit version is v0.
117
114
@@ -222,11 +219,6 @@ Deploying a new model to an existing runtime.
222
219
223
220
# Open Questions
224
221
225
-
## Use deprecation window to handle backward compatibility
226
-
One future option is to keep both old and new operators, but set a certain deprecation window for old operators. Deprecate the old operator when the window expires. There are some open questions on this option:
227
-
* What would be the window length? Would it be different for different situations (internal vs. external, server vs. mobile, etc.)
228
-
* From user's point of view, the number of operators my bloat, but the old operators out of SLA BC window can be removed.
229
-
230
222
## Downgraders for FC
231
223
Dual to upgreaders for BC on client, downgraders can be used for FC on server. There are several options:
232
224
* We set a 2-week (maybe 3 week) FC window. The FC break update is split into two PRs. The first PR with new operator readers is rolled out. After the FC window (supposing all client runtime are updated to be able to read the new operator), the producer of the new operators are turned on to generate models with new operator schema.
0 commit comments