Bumps supported file format in anticipate of torch.div changes (#39529)

Summary:
See https://github.com/pytorch/pytorch/pull/38620 for additional context.

When PyTorch begins producing file format 4 with the updated div behavior it's safe for older PyTorch versions to consume it, since file format 4 only prohibits functionality. Bumping the supported file format version now gives PyTorch users on Master some leeway on updating their services that consume vs. produce PyTorch.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39529

Differential Revision: D21886790

Pulled By: mruberry

fbshipit-source-id: d6098eff06c26f18c3fac5cc85e5db298ba86e27
This commit is contained in:
Mike Ruberry 2020-06-04 19:32:09 -07:00 committed by Facebook GitHub Bot
parent 17aebe909f
commit 7d56ef27ee

View File

@ -91,12 +91,16 @@ namespace caffe2 {
namespace serialize {
constexpr uint64_t kMinSupportedFileFormatVersion = 0x1L;
constexpr uint64_t kMaxSupportedFileFormatVersion = 0x3L;
constexpr uint64_t kMaxSupportedFileFormatVersion = 0x4L;
// Versions (i.e. why was the version number bumped?)
// 1. Initial version
// 2. Removed op_version_set version numbers
// 3. Added type tags to pickle serialization of container types
// 4. (Currently read-only) Will change torch.div to throw a runtime error
// when it would have performed floor division. Bumping the version counter
// will let us presever torch.div's historic behavior for programs
// serialized with file formats 1--3.
constexpr uint64_t kProducedFileFormatVersion = 0x3L;
// Writer-specific constants